#include <stdio.h>
int main(int argc, const char * argv[]) {
int a = -1, b = -1; //定义二个整型变量来接收输入的值
printf("请输入二个整数,并以逗号隔开:\n");
scanf("%d,%d", &a,&b);
int sum = a + b; //定义两整数之和
int minus = a - b; //定义两整数只差
int product = a * b; //定义两整数之积
int quotient = a / b; //定义两整数之商
int remainder = a % b; //定义两整数之余数
printf("a+b=%d, a-b=%d, a*b=%d, a/b=%d, a % b=%d\n", sum, minus, product, quotient, remainder);
return 0;
}
为什么输出的结果a%b,没有取余符号输出??? |
|