#include<stdio.h>
#include<stdlib.h>
int main()
{
float s, temp;
char ch;
printf("Please input:");
scanf("%f", &s);
//ch = getchar();
while ((ch = getchar())!= ';')
{
scanf("%f", &temp);
switch (ch)
{
case'+': s = s + temp;
break;
case'-': s = s - temp;
break;
default:printf("error\n");
}
//ch=getchar();
}
printf("%f", s);
system("pause");
return 0;
}
黄迪明3.7
最新推荐文章于 2017-07-11 10:02:10 发布