Open sq4250 opened 1 year ago
```#include<stdio.h> char a;double x,y; int main() { for(int i=0;i<5;i++){ scanf("%lf%c%lf",&x,&a,&y); switch (a) { case '+':printf("%.2lf+%.2lf=%.2lf\n",x,y,x+y);break; case '-':printf("%.2lf-%.2lf=%.2lf\n",x,y,x-y);break; case '*':printf("%.2lf*%.2lf=%.2lf\n",x,y,x*y);break; case '/': if(y==0) printf("Error!\n"); else printf("%.2lf/%.2lf=%.2lf\n",x,y,x/y);break; default:printf("Error!\n"); } } return 0; }