本题链接: 小明种苹果
本博客给出本题截图:
C++
#include <iostream> #include <cstring> #include <algorithm> using namespace std; int main() { int n, m; scanf("%d%d", &n, &m); int T = 0, K, P = -1; for (int i = 1; i <= n; i ++ ) { int tot, sum = 0, x; scanf("%d", &tot); for (int j = 0; j < m; j ++ ) { scanf("%d", &x); sum += abs(x); } T += tot - sum; if (sum > P) K = i, P = sum; } cout << T << ' ' << K << ' ' << P << endl; return 0; }
总结
水题,不解释