UVa-Ecological Premium

题目地址:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&category=15&problem=1241&mosmsg=Submission+received+with+ID+12041586

C++代码:

 

#include <iostream>
using namespace std;
int main()
{
	int a,b,c;
	int n,f;
	while(cin>>n)
	{
		while(n--)
		{
			cin>>f;
			int sum=0;
			while(f--)
			{
				cin>>a>>b>>c;
				sum+=a*c;
			}
			cout<<sum<<endl;
		}
	}
	return 0;
}


 

 

posted @ 2013-07-13 20:59  爱生活,爱编程  阅读(184)  评论(0编辑  收藏  举报