Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<string.h>
- int main()
- {
- long long t,i,d=0,s=0;
- char n[100];
- while(scanf("%lld",&t)==1)
- {
- for(i=1;i<=t;i++)
- {
- scanf("%s",n);
- if(strcmp(n,"donate")==0)
- {
- scanf("%lld",&d);
- s=s+d;
- }
- else
- printf("%lld\n",s);
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement