怎么还没结果
#include
#include
#include
main()
{
float a,b,m,x=0;
int i=1;
char c='0',d;
printf("乘方:!\t开方:@\t清空#\t\n");
printf("=====================================\n\n");
printf("0");
while(i)
{
if(scanf("%f%c%f",&a,&c,&b))
{
switch(c)
{
case '+':x=a+b;
printf("=%f\n",x);
printf("%f",x);
break;
case '-':
x=a-b;
printf("=%f\n",x);
printf("%f",x);
break;
case '*':scanf("%f",&m);
x=a*b;
printf("=%f\n",x);
printf("%f",x);
break;
case '/':scanf("%f",&m);
x=a/b;
printf("=%f\n",x);
printf("%f",x);
break;
case '!':x=pow(a,b);
printf("=%f\n",x);
printf("%f",x);
break;
default:printf("输入错误\n\n");
}
}
else if(scanf("%c",&c))
{
switch(c)
{
case '+':
scanf("%f",&m);
x=m+x;
printf("=%f",x);
break;
case '-':
scanf("%f",&m);
x=x-m;
printf("=%f",x);
break;
case '*':
scanf("%f",&m);
x=m*x;
printf("=%f",x);
break;
case '/':
scanf("%f",&m);
x=x/m;
printf("=%f",x);
break;
case '#':
x=sqrt(x);
printf("X开方得%f\n",x);
printf("%f",x);
break;
case '@':
x=0;
printf("0");
break;
case '!':
x=pow(x,m);
printf("=%f",x);
break;
default:
printf("输入错误\n\n");
printf("%f",x);
}
getchar();
}
}
system("PAUSE");
}