- #include <bits/stdc++.h>
- using namespace std;
- int main(){
- int t, n, p, cs = 0;
- string inp;
- cin >> t;
- while(t--){
- cin >> n;
- long long ans = 0;
- cout << "Case " << ++cs << ":" << endl;
- for(int i = 0; i < n; i++){
- cin >> inp;
- if(inp == "donate"){
- cin >> p;
- ans += (long long)p;
- }
- else cout << ans << endl;
- }
- }
- return 0;
- }
No comments:
Post a Comment