#include <stdio.h> #include <math.h> int main(){ int a,c; char b; if (scanf("%d %c %d",&a,&b,&c)!=EOF){ //printf("%d %c %d",a,b,c); if (b == '+'){printf("%d",a+c);} else if (b == '-'){printf("%d",a-c);} else if (b == '*'){printf("%d",a*c);} else if (b == '/'){printf("%d",a/c);} else if (b == '%'){printf("%d",a%c);} else{printf("ERROR");} }else{ printf("input wrong"); } return 0; }
c语言编程练习题:7-98 两个数的简单计算器
作者:yunjinqi
类别:编程
日期:2023-05-31 10:39:57
阅读:581 次
消耗积分:0 分
版权所有,转载本站文章请注明出处:云子量化, https://www.yunjinqi.top/article/223
最新文章
系统当前共有 403 篇文章