求修正
查看原帖
求修正
976067
wczxluo楼主2023/8/3 17:38
#include<bits/stdc++.h>
using namespace std;
struct qwe{
	long long h;
	long long j;
}a[21];
bool comp(qwe x,qwe y)
{
	return x.h<y.h;
}
int main()
{
	int n;
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		cin>>a[i].h;
		a[i].j=i;
	}
	sort(a+1,a+1+n,comp);
	cout<<a[n].j<<endl<<a[n].h;
	return 0;
 } 
2023/8/3 17:38
加载中...