0
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n, i, n1, c = 0, c1, c2, max, pos, bar[501], arr[250001], j;
cin >> n >> n1;
max = pos = 0;
for (i = 1; i <= n*n1; i++)
{
cin >> arr[i];
}
for (i = 1; i <= n; i++)
{
c = 0;
for (j = i; j <= n1*n; j += (n))
{
c += arr[j];
}
if (max <= c)
{
max = c;
pos = i;
}
}
cout << pos << endl;
return 0;
}
I know that cis is scan, the rest I don’t even know where it goes
– So pergunto
The code is almost valid in
c
. Theinclude
is distinct (only needs the<stdio>
), is not usednamespace
, impression is withprintf
– Jefferson Quesado
@Sopergunto Did any of the answers solve your question? Do you think you can accept one of them? See the [tour] how to do this, if you haven’t already. You would help the community by identifying what was the best solution for you. You can accept only one of them. But you can vote on any question or answer you find useful on the entire site (when you have enough score).
– Maniero