#include<cstdio> #include<cstring> using namespace std; int main() { int a,b,c,cnt=0,res; char sign, s[10]; while (scanf("%d %c %d %s",&a,&sign,&b,s)!=EOF) { if (s[0]!='?') { int l=strlen(s); c=0; for (int i=1;i<l;i++) c=c*10+s[i]-'0'; res=sign=='+'?a+b:a-b; if (res==c) cnt++; } } printf("%d\n",cnt); return 0; }
Sunday, July 17, 2016
UVA 11878 Solution
Unknown
Studying at Shahjalal University of Science and Technology, Sylhet.
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment