#include <stdio.h>
#include <stdlib.h>
int main()
{
int a,b,c,d,e,f;
scanf("%d %d",&a,&b);
c=a+b;
d=a-b;
e=a*b;
f=a/b;
printf("%d\n%d\n%d\n%d\n",c,d,e,f);
return 0;
}
C语言基本运算示例
本文提供了一个使用C语言进行基本数学运算的示例程序,包括加法、减法、乘法和除法操作。通过输入两个整数,程序将展示如何计算并输出这些基本运算的结果。
#include <stdio.h>
#include <stdlib.h>
int main()
{
int a,b,c,d,e,f;
scanf("%d %d",&a,&b);
c=a+b;
d=a-b;
e=a*b;
f=a/b;
printf("%d\n%d\n%d\n%d\n",c,d,e,f);
return 0;
}
2238
5027
1322

被折叠的 条评论
为什么被折叠?