http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=94&page=show_problem&problem=1241
水题
精神状态不是很好,反应有点慢。
可UVA开个网页好慢,提交后判定更慢。。。
#include <iostream>
using namespace std;
int main()
{
int nCase;
int nFarmer;
while ( cin >>nCase )
{
while ( nCase-- )
{
cin >>nFarmer;
int iSpace, iAnimal, iDegree;
int nSum = 0;
for ( int i=0; i<nFarmer; i++ )
{
cin >>iSpace >>iAnimal >>iDegree;
nSum += iSpace * iDegree;
} // end for
cout <<nSum <<endl;
} // end while
} // end while
return 0;
}