Saturday, 3 October 2015

UVA_12403_Save Setu_Solution

// Tanzila Islam

// Southeast University

// mail : tanzilamohita@gmail.com


#include<bits/stdc++.h>

using namespace std;

int main(){

int n, money, current = 0;

string s;

cin >> n;

while(n--){

        cin >> s;

        if(s == "donate"){

           cin >> money;

        current+=money;

        }

        else cout << current << endl;


}

return 0;

}

No comments:

Post a Comment