PROGRAMMING PROBLEMS & SOLUTIONS
Pages
HOME
URI
UVA
CODEFORCES
HACKERRANK
EXTRA
CONTACT
Sunday, May 1, 2016
UVA problem 12403 - Save Setu
Problem link (
Click here
)
#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
int main()
{
int n,b;
int report=0;
string a;
cin>>n;
getchar();
while(n--)
{
cin>>a;
if(a=="donate"){
cin>>b;
report=report+b;
}
else
printf("%d\n", report);
}
return 0;
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment