You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
506 B
28 lines
506 B
#include <bits/stdc++.h>
|
|
|
|
using namespace std;
|
|
|
|
int main() {
|
|
//录入数据到vector数组
|
|
int n;
|
|
cin >> n;
|
|
vector<int> vec;
|
|
for (int i = 0; i < n; i++) {
|
|
int c;
|
|
cin >> c;
|
|
vec.push_back(c);
|
|
}
|
|
int max = INT32_MIN;
|
|
int inx = -1;
|
|
|
|
for (int i = 0; i < n; i++) {
|
|
if (vec[i] > max) {
|
|
max = vec[i];
|
|
inx = i;
|
|
}
|
|
}
|
|
cout << max << endl;
|
|
cout << inx + 1 << endl;
|
|
return 0;
|
|
}
|