链接http://acm.swust.edu.cn/problem/276/
#include <stdio.h> int main() { int a,b; char d; while(scanf("%d%c%d",&a,&d,&b)!=EOF) { switch(d) { case ‘+‘:printf("%d%c%d=%d\n",a,d,b,a+b);break; case ‘-‘:printf("%d%c%d=%d\n",a,d,b,a-b);break; case ‘*‘:printf("%d%c%d=%d\n",a,d,b,a*b); break; case ‘/‘:printf("%d%c%d=%d\n",a,d,b,a/b);break; } } return 0; }
时间: 2024-12-14 23:11:37