#include
#include
void main()
{
clrscr();
int i;float number[100],sump,sumn,total;char ch[100];
for( i=1;i<=100;i++)
{
if(i%2==1)
scanf("%c",&ch[i]);
else
scanf("%d",&number[i]);
if(ch[i]=='=')
i=1000;
}
for( i=1;i<=100;i+=2)
{
if(ch[i]=='+')
sump=sump+number[i+1];
if(ch[i]=='-')
sumn=sumn+number[i+1];
}
total=sump-sumn;
printf("%f",total);
// printf("hhhhh");
getchar();
}
0 comments:
Post a Comment