// UVa 12403 - Save Setu #include <iostream> using namespace std; #define integer unsigned long long int main() { int n; integer money = 0; for (cin >> n; n; n--) { string op; cin >> op; if (op[0] == 'r') cout << money << endl; else { integer donation; cin >> donation; money += donation; } } return 0; }
No comments:
Post a Comment