#include<bits/stdc++.h>
using namespace std;
int main()
{
string r;
long int a = 0, i, k, n;
cin >> n;
for(i=1;i<=n;i++)
{
cin >> r;
if(r == "donate")
{
cin >> k;
a += k;
}
else
cout << a << endl;
}
return 0;
}
using namespace std;
int main()
{
string r;
long int a = 0, i, k, n;
cin >> n;
for(i=1;i<=n;i++)
{
cin >> r;
if(r == "donate")
{
cin >> k;
a += k;
}
else
cout << a << endl;
}
return 0;
}
Comments
Post a Comment