您的位置:首页 > 其它

黄迪明3.7

2016-02-11 13:55 323 查看
#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;
}


内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: