Untitled

mail@pastecode.io avatar
unknown
c_cpp
7 months ago
341 B
0
Indexable
Never

#include <iostream>
using namespace std;

int main()
{
    int n = 0;
    cin >> n;
    int tmp;
    int kol;
    int max = -1;
    for (int i = 0; i < n; i++) {
        cin >> tmp;
        if (tmp > max) {
            kol = i + 1;
            max = tmp;
        }
    }
    cout << max << endl;
    cout << kol;
}

Leave a Comment