代码:
#include <stdio.h>
int main()
{
int n,f,a,b,c;
int sum;
scanf("%d",&n);
while(n--)
{
scanf("%d",&f);
sum=0;
while(f--)
{
scanf("%d%d%d",&a,&b,&c);
sum+=a*c;
}
printf("%d\n",sum);
}
return 0;
}
代码:
#include <stdio.h>
int main()
{
int n,f,a,b,c;
int sum;
scanf("%d",&n);
while(n--)
{
scanf("%d",&f);
sum=0;
while(f--)
{
scanf("%d%d%d",&a,&b,&c);
sum+=a*c;
}
printf("%d\n",sum);
}
return 0;
}