alphacademy-cpp/archive/hf17/1.cpp
2022-10-08 13:07:07 +02:00

42 lines
729 B
C++

#include <bits/stdc++.h>
#include <iostream>
using namespace std;
int vectorAverage(vector<int> n){
int out;
int temp = 0;
for (int i = 0; i<n.size(); i++) {
temp = n[i] + temp;
}
out = temp / n.size();
return out;
}
int main() {
int n, m, temp, out;
temp = 0;
cin>>n>>m;
vector<vector<int>> nap(m, vector<int> (n));
vector<int> temp1(m);
for (int i = 0; i<n; i++) {
for (int j = 0; j<m; j++) {
cin >> nap[i][j];
}
}
for (int i = 0; i<n; i++) {
for (int j = 0; j<m; j++) {
temp1[j] = nap[i][j];
}
if (vectorAverage(temp1) > temp) {
out = i +1;
}
}
cout<<out;
}