mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-12-03 19:16:27 +00:00
716. 最大数和它的位置
https://www.acwing.com/problem/content/submission/code_detail/6943184/
This commit is contained in:
parent
58db81b52b
commit
54ec15dc5a
21
AcWing/716/716.cpp
Normal file
21
AcWing/716/716.cpp
Normal file
@ -0,0 +1,21 @@
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int t, ans1, ans2;
|
||||
|
||||
int main() {
|
||||
for (int i = 1; i <= 100; i++) {
|
||||
cin >> t;
|
||||
|
||||
if (t > ans1) {
|
||||
ans1 = t;
|
||||
ans2 = i;
|
||||
}
|
||||
}
|
||||
|
||||
cout << ans1 << endl
|
||||
<< ans2 << endl;
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user