UVa 10300 Ecological Premium

题目链接http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&category=24&problem=1241&mosmsg=Submission+received+with+ID+11339336

每个事件每一行的第一和第三相乘,总的相加即可

#include"stdio.h"
int main()
{
int apple,pea,orange,tomato,grape,potato;
scanf("%d",&apple);
while(apple--)
{
scanf("%d",&pea);
grape=0;
while(pea--)
{
scanf("%d%d%d",&orange,&tomato,&potato);
grape=grape+orange*potato;
}
printf("%d\n",grape);
}
return 0;
}

原文地址:https://www.cnblogs.com/miaosu5limi/p/2932471.html