#include "stdio.h"
main()
{
double m=0,n=0;
for(;;)
{
scanf("%f",&n);
if(getchar()=='+')
{
scanf("%f",&m);
n+=m; printf("=%f",n);
}
if(getchar()=='-')
{
scanf("%f",&m);
n-=m; printf("=%f",n);
}
if(getchar()=='*')
{
scanf("%f",&m);
n*=m; printf("=%f",n);
}
if(getchar()=='/')
{
scanf("%f",&m);
if(m==0)printf("error");
else n/=m; printf("=%f",n);
}
}
}
四则运算计算器的编程...我错在哪里呀?请高手指点!