2024-06-07 03:11:16
求解怎么改
#include<stdio.h>
int main()
{
int n,a,b,sum,sub,multi,mod;
float dev;
char op;
printf("please input n:\n");
scanf("%d",&n);
a=n/100;
b=n%100;
printf("%d,%d\n",a,b);
sum=a+b;
printf("sum=%d\n",sum);
sub=a-b;
printf("sub=%d\n",sub);
multi=a*b;
printf("multi=%d\n",multi);
if (b==0)
{
printf( "the second operater is zero!\n");
}
else
{
dev=a/b;
printf("dev=%.2f\n",dev);
}
if (b==0)
{
printf( "the second operater is zero!\n");
}
else
{
mod=a%b;
printf("mod=%d\n",mod);
}
return 0;
}