0
已解决
夏梓轩
初级守护
初级守护
555有大佬帮忙吗
#include <iostream>
using namespace std;
int main(){
int a[105],n,x,y,maxn=0,pos=0;
cin>>n;
for(int i=1;i<=n;i++){
cin>>a[i];
}
cin>>x>>y;
x=a[x-1];
y=a[y-1];
for(int i=1;i<=n;i++){
if(a[i]>=maxn){
maxn=a[i];
pos=i;
}
}
cout<<maxn<<' '<<pos<<endl;
cout<<x<<' '<<y;
return 0;
}
夏梓轩在2023-10-18 21:52:36追加了内容
谁先回答给谁!!!!!!!!!!!!!!!!!!!!!!!!!!急急急急急!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!