这题看得有点迷糊,但是用了下灵格斯就懂题意了,直接上代码:
#include<iostream>
using namespace std;
int main()
{
int n, f, a, b, c;
while(cin >> n)
{
while( n --)
{
cin >> f;
int sum = 0;
for( int i = 0; i < f; i ++)
{
cin >> a >> b >> c;
sum += a * c;
}
cout << sum << endl;
}
}
return 0;
}
一个求和...
浙公网安备 33010602011771号