王老师
回答题目:2621条
程序如下:
#include
void main()
{
x05int num1,num2,sum,min,mul,yushu;
x05float shang;
x05scanf("%d",&num1);
x05scanf("%d",&num2);
x05sum = num1 + num2;
x05min = num1 - num2;
x05mul = num1 * num2;
x05shang = (float)num1 / num2;
x05yushu = num1 % num2;
x05printf("%d %d %d %0.2f %dn",sum,min,mul,shang,yushu);
}
------------------------------------------------------------------------------------------------------------------
再修改一次:
#include
void main()
{
x05int num1,num2,sum,min,mul,yushu;
x05float shang;
x05printf("请输入num1:");
x05scanf("%d",&num1);
x05printf("请输入num2:");
x05scanf("%d",&num2);
x05sum = num1 + num2;
x05min = num1 - num2;
x05mul = num1 * num2;
x05shang = (float)num1 / num2;
x05yushu = num1 % num2;
x05printf("%d + %d=%dn",num1,num2,sum);
x05printf("%d - %d=%dn",num1,num2,min);
x05printf("%d * %d=%dn",num1,num2,mul);
x05printf("%d / %d=%0.2fn",num1,num2,shang);
x05printf("%d %% %d=%dn",num1,num2,yushu);
}