Untitled
unknown
c_cpp
2 years ago
341 B
4
Indexable
#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; }
Editor is loading...
Leave a Comment