#include<stdio.h> int main(void){ int a,b,c,d; char x; printf("\t\t\t计算器\n"); while(scanf("%d%c%d",&a,&x,&b)){ switch(x){ case '+': c=a+b; printf("=%d\n",c); break; case '-': c=a-b; printf("=%d\n",c); break; case '*': c=a*b; printf("=%d\n",c); break; case '/': c=a/b; d=a%b; printf("=%d......%d\n",c,d); break; } } printf("\n"); return 0; }
初级程序员
by: 云代码会员 发表于:2018-05-12 10:39:23 顶(0) | 踩(0) 回复
太简易了呀
回复评论