első feladat 16 órára

This commit is contained in:
Iván Sándor 2022-05-21 13:53:48 +02:00
parent 65bad1f04e
commit 39125d2d97

46
hf16/1.cpp Normal file
View file

@ -0,0 +1,46 @@
#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;
}