12403

#include <iostream>
#include <stdio.h>
#include <string.h>



using namespace std;

int main()
{
    int t,n;
    char str[100],s[20];
    cin>>t;
    getchar();
    int sum=0;
    while(t--)
    {
       gets(str);

       if(strcmp(str,"report")==0)
       {
          sprintf(s,"%d",sum);
          puts(s);
       }
       else
       {
           sscanf(str,"%s %d",s,&n);
           sum+=n;
       }
    }

    return 0;
}

 

Leave a Reply

Your email address will not be published. Required fields are marked *