문제 링크
t가 처음 주어진다.
그 다음 t줄 동안 donate n 혹은 report가 입력으로 주어진다.
그냥 구현...
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define INF 1000000000
int t;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cin >> t;
int totalMoney = 0;
for (int tc = 1; tc <= t; tc++){
string s;
cin >> s;
if (s == "donate") {
int money;
cin >> money;
totalMoney += money;
}
else {
cout << totalMoney << '\n';
}
}
}