请大虾帮小弟修改下,我每次都是只能弄到+法,但是其它的都不行!!急求啊!!
main()
{
int a,b,c;
scanf("%d %d",&a,&b);
scanf("%d",&c);
if(c='+')
printf("%d",a+b);
else if(c='-')
printf("%d",a-b);
else if(c='*')
printf("%d",a*b);
else
printf("%d",a/b);
return 0;
}
请大虾帮小弟修改下,我每次都是只能弄到+法,但是其它的都不行!!急求啊!!
main()
{
int a,b,c;
scanf("%d %d",&a,&b);
scanf("%d",&c);
if(c='+')
printf("%d",a+b);
else if(c='-')
printf("%d",a-b);
else if(c='*')
printf("%d",a*b);
else
printf("%d",a/b);
return 0;
}