#include<stdio.h> int main() {int i,k=0; char c,sfjx='Y'; while(sfjx='Y')

{puts("please input a mumber:\n");
scanf("%d",&i);getchar();
puts("please choose a rule");
scanf("%c",&c);
switch(c)
{case'a':k=k+i;printf("%d",k);break;
case'b':k=k-i;printf("%d",k);break;
case'c':k=k*i;printf("%d",k);break;
case'd':k=k/i;printf("%d",k);break;
case'e':k=k%i;printf("%d",k);break;
default:printf("enter bata error!\n");}
puts("Continue? input Y,othise N");
sfjx=getchar();
return 0;
}
请问哪个地方错了

#include<stdio.h>
int main()
{int i,k=0;
char c,sfjx='Y';
while(sfjx=='Y')
{puts("please input a mumber:\n");
scanf("%d",&i);getchar();
puts("please choose a rule");
scanf("%c",&c);
switch(c)
{case'a':k=k+i;printf("%d",k);break;
case'b':k=k-i;printf("%d",k);break;
case'c':k=k*i;printf("%d",k);break;
case'd':k=k/i;printf("%d",k);break;
case'e':k=k%i;printf("%d",k);break;
default:printf("enter bata error!\n");
}
puts("Continue? input Y,othise N");
sfjx=getchar();

}
return 0;
}
温馨提示:答案为网友推荐,仅供参考
相似回答