MY name is ruhul amin

ISLAMIC UNIVERSITY OF KUSHTIA

Tuesday, March 5, 2013

uva problem 10300

#include<stdio.h>
int main()
{
    long int i,j,k,n,a,b,c,s,m;
    while(scanf("%ld",&n)==1)
    {
        for(i=1;i<=n;i++)
        {
            scanf("%ld",&m);
            s=0;
            for(j=1;j<=m;j++)
            {
                scanf("%ld%ld%ld",&a,&b,&c);
                s=s+a*c;
            }
            printf("%ld\n",s);
        }
    }
    return 0;
}

No comments:

Post a Comment