jakaria_hossain

lightoj - 1387 - Setu

Aug 23rd, 2019
125
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5. int te;
  6. cin>>te;
  7. for(int t=1;t<=te;t++)
  8. {
  9. long long donate,n,account=0;
  10. string cmd;
  11. cin>>n;
  12. printf("Case %d:\n",t);
  13. while(n--)
  14. {
  15. cin>>cmd;
  16. if(cmd=="donate")
  17. {
  18. cin>>donate;
  19. account+=donate;
  20. }
  21. else
  22. {
  23. cout<<account<<endl;
  24. }
  25. }
  26. }
  27. }
RAW Paste Data