Uva 12403 – Save Setu


Solution :-

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

int main ()
    int t,s=0,d=0;
    char a [100];
    scanf (“%d”, &t);
    while ( t–)
        scanf (“%s”, a);
        if (strcmp (a, “donate”)==0)
            scanf (“%d”, &d);
            s += d;
        printf (“%dn”, s);

    return 0;

At First you can try to solve this problem if you can’t than see this code & find what’s your problem . If you copy paste this code you could not improve yourself in programming .

Posted by Shipu Ahamed

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.