#include <stdio.h>
int main(int argc, const char * argv[]) {
int a = 0;
int b = 0;
printf("请输入两个整数:\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);//printf函数打印 % 字符要用 %% 才能打印
return 0;
}
时间: 2025-01-10 23:38:49