jun-csbio / CClass_ZJUT

CClass_ZJUT
1 stars 0 forks source link

genshin start. #8

Open sq4250 opened 1 year ago

sq4250 commented 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;
}