编写程序,从键盘输入两个整数给a和b,求他们的和,差,商数和余数,并输出...答: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); //余 retu...
编写一个程序,从键盘读入两个整数,把它们相乘,然后打印这两个整数及...答:void main(){ int a,b,sum;printf("请输入两个整数\n");scanf("%d %d",&a,&b);sum=a+b;printf("the sum is:%d\n",sum);} 主函数一般是没有返回值的,应该用void;变量应该先定义,后使用,所以int a,b,sum;要放在scanf("%d %d"&a,&b);的前面; Scanf那句引号后有个逗号; ...