C语言纠错
#include <stdio.h>#include <math.h>
int main()
{double num1,num2,result;
char op;
printf("enter num1&op&num2:");
scanf("%lf%c%lf",&num1,&op,&num2);
if (op=='+')
result=num1+num2;
else if (op=='-')
result=num1-num2;
else if (op=='*')
result=num1*num2;
else (op=='/');
result=num1/num2;
printf("result=%.2lf\n",result);
return 0;
}
我是新手,求大神找错,结果总是1.00