alphacademy-cpp/archive/hf16/1.cpp

46 lines
812 B
C++
Raw Normal View History

2022-05-21 11:53:48 +00:00
#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;
}