70,024
社区成员




#include<ctype.h>
int main(void)
{
float number_f;
float number_s;
char operation;
char choice_1;
do
{
printf("Please Edit the chaculation\n");
scanf("%f%c%f",&number_f,&operation,&number_s);/////////////////////////
switch(operation)
{
case '+':
printf("You answer is %1f\n",number_f+number_s);
break;
case '-':
printf("You answer is %1f\n ",number_f-number_s);
break;
case '/':
if(number_s==0)
printf("the number s you put in is wrong\n");
else
printf("You answer is %1f \n",number_f/number_s);
break;
case '*':
printf("You answer is %1f\n" ,number_f*number_s);
break;
}
printf("DO you want anymore\n");
printf("Please Edit Y/N\n");
//fflush(stdin);///////////////////////////////////////
scanf(" %c",&choice_1);
}
while(choice_1 == 'y' || choice_1 == 'Y');///////////////////////
return 0;
}
非常感谢各位大大
好像可以了