2个回答
推荐于2016-04-11
展开全部
#include <stdio.h>
int main()
{
int a,b;
printf("Input a, b: \n");
scanf("%d %d",&a,&b);
printf("a + b =: %d\n",a+b);
printf("a - b =: %d\n",a-b);
printf("a * b =: %d\n",a*b);
printf("a / b =: %d\n",a/b);
printf("a %% b =: %d\n",a%b); //余
return 0;
}
结果:
Input a, b:
9 5
a + b =: 14
a - b =: 4
a * b =: 45
a / b =: 1
a % b =: 4
int main()
{
int a,b;
printf("Input a, b: \n");
scanf("%d %d",&a,&b);
printf("a + b =: %d\n",a+b);
printf("a - b =: %d\n",a-b);
printf("a * b =: %d\n",a*b);
printf("a / b =: %d\n",a/b);
printf("a %% b =: %d\n",a%b); //余
return 0;
}
结果:
Input a, b:
9 5
a + b =: 14
a - b =: 4
a * b =: 45
a / b =: 1
a % b =: 4
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询