c语言字符加减运算求大神看看
#include<stdio.h>intmain(){charch3,ch1,ch2,ch4;scanf("%c%c%c",&ch3,&ch1,&ch2);if(ch3=...
#include <stdio.h>
int main()
{
char ch3,ch1,ch2,ch4;
scanf("%c%c%c",&ch3,&ch1,&ch2);
if (ch3==45)
{ch4=ch1-ch2;
}
if (ch3==43)
{ch4=ch1+ch2;
}
printf("%d\n",ch4);
return 0;
} 展开
int main()
{
char ch3,ch1,ch2,ch4;
scanf("%c%c%c",&ch3,&ch1,&ch2);
if (ch3==45)
{ch4=ch1-ch2;
}
if (ch3==43)
{ch4=ch1+ch2;
}
printf("%d\n",ch4);
return 0;
} 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询