You are on page 1of 1

#include <bits/stdc++.

h>
using namespace std;
int main()
{
char c;
int s=0,x;
ifstream f("expresie.in");
f>>c;
x=c-'0';
while(f>>c)
{
if(c=='+')
{
f>>c;
int y=c-'0';
x=x+y;
}
else
if(c=='-')
{
f>>c;
int z=c-'0';
x=x-z;
}
}
cout<<x;
}

You might also like