2015年1月27日20:17:11
1.从键盘读入两个数,并输出这两个数的和、差、积与商。
#include <stdio.h>
#include <stdlib.h>
int main()
{
int a,b,c;
printf("这是一个计算两个整数的和、差、积与商的小工具!\r\n");
printf("请输入两个整数,中间以空格符隔开!\r\n");
scanf("%d %d",&a,&b);
c = a + b;
printf("%d + %d = %d\r\n",a,b,c);
c = a - b;
printf("%d - %d = %d\r\n",a,b,c);
c = a * b;
printf("%d * %d = %d\r\n",a,b,c);
c = a / b;
printf("%d / %d = %d\r\n",a,b,c);
system("pause");
return 0;
}