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

46 lines
812 B
C++

#include <bits/stdc++.h>
#include <iostream>
using namespace std;
int combineVectorValues(vector<int> v) {
int out;
for (int i = 0; i < v.size(); i++) {
out = out+ v[i];
}
return out;
}
int indexOfLargestValue(vector<int> n) {
int out;
int temp = 0;
for (int i = 0; i < n.size(); i++) {
if (n[i]>temp) {
out = i;
temp = n[i];
}
}
return out;
}
int main() {
int n;
cin >> n;
vector<int> hetek(n);
vector<int> temp(7);
for (int i = 0; i<n; i++){
for (int j = 0; j<7; j++) {
cin >> temp[j];
}
hetek[i] = combineVectorValues(temp);
}
// for (int i = 0; i<hetek.size(); i++) {
// cout<<hetek[i]<<" ";
// }
cout<<indexOfLargestValue(hetek)+1;
}