#include<bits/stdc++.h> using namespace std; int main() { int n; cin>>n; int last=-1; for(int i=1;i<=n;i++) { int x; cin>>x; if(x>last) //持续上升 { last=x; } else //无法移动了 { break; } } cout<<last; return 0; }
#include<bits/stdc++.h> using namespace std; int main() { bool jud=true; int n,now; cin>>n; for(int i=1;i<=n;i++) { int x; cin>>x; if(i==1) now=x; else { if(x>now && jud) now=x; else jud=false; } } cout<<now; return 0; }
Using your lizikid universal account