编写C语言程序,输入两个的正整数,求出它们的和、差、积、商。

如题所述

#include"stdio.h"
int main()
{
int a,b;
scanf("%d%d",&a,&b);
if(b==0)b=1;
printf("和%d\n",a+b);
printf("积%d\n",a*b);
printf("差%d\n",a-b);
printf("商%.2lf\n",a*1.0/b);
return 0;
}
温馨提示:内容为网友见解,仅供参考
第1个回答  2012-02-23
#include<stdio.h>

void main()
{
float x,y;
printf("please input a x and a y:");
scanf("%f%f",&x,&y);

printf("%f %f %f %f\n",x+y,x-y,x*y,x/y);
}
第2个回答  2012-02-23
太难了,我帮你问问百度!
第3个回答  2018-09-26
你确定stdio是引号
相似回答