题目链接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;
}

posted on 2013-02-25 17:49  秒速5CM  阅读(161)  评论(0编辑  收藏  举报