39页作业(求加减乘除)
#include<stdio.h> int main() { int num1,num2,a; double m,n; printf("enter num1 and num2:"); scanf("%d%d",&num1,&num2); if(num1<num2){ a=num1; num1=num2; num2=a; } printf("result1=%d\n",num1+num2); printf("result2=%d\n",num1-num2); printf("result3=%d\n",num1*num2); m=num1; n=num2; printf("result4=%.3f\n",m/n); printf("result5=%d\n",num1%num2); return 0; }