#include<iostream>
using namespace std;
int main()
{
int tCase, nCase, t = 0, n, m, sum ;
string s;
cin >> tCase;
while(tCase--)
{
cin >> n;
sum = 0;
cout << "Case " << ++t << ":" << endl;
while(n--)
{
cin >> s;
if(s == "donate")
{
cin >> m;
sum += m;
}
if(s == "report")
cout << sum << endl;
}
}
return 0;
}
using namespace std;
int main()
{
int tCase, nCase, t = 0, n, m, sum ;
string s;
cin >> tCase;
while(tCase--)
{
cin >> n;
sum = 0;
cout << "Case " << ++t << ":" << endl;
while(n--)
{
cin >> s;
if(s == "donate")
{
cin >> m;
sum += m;
}
if(s == "report")
cout << sum << endl;
}
}
return 0;
}
ahmed shuvo969
আহমেদ শুভ৯৬৯
কোন মন্তব্য নেই:
একটি মন্তব্য পোস্ট করুন