UVA-12403 (Save Setu)
#include<stdio.h>
int main()
{
char s[100];
int a,sum=0,n;
scanf("%d",&n);
while(0<n)
{
scanf("%s",s);
if(strcmp(s,"donate")==0)
{
scanf("%d",&a);
sum=sum+a;
}
else
{
printf("%d\n",sum);
}
n--;
}
return 0;
}
This is my personal collection of daily lessons, professional insights, and programming experiences. It’s a space where I document what I learn, and you can explore and learn from my journey too.
No comments:
Post a Comment