(UVA)10300-農場
#include<stdio.h> int main(){ int n; while ((scanf("%d", &n)) != EOF){ while (n--){ int sum = 0, i, j; scanf("%d", &i); for (j = 0; j < i; j++) { int a, b, c; scanf("%d%d%d", &a, &b, &c); sum = sum + a*c; } printf("%d\n", sum); } } return 0; }
留言
張貼留言