为什么才20分
查看原帖
为什么才20分
557408
Tony_rao楼主2022/7/6 21:59
#include<bits/stdc++.h>
using namespace std;


int c(int x,int num,int ans)
{
  if(x != 0)
    c(x-1,num,ans*num);
  else
    return ans ;
}
int f;

struct ryy
{
  int h,z;
} a[100000];

int Sort(ryy x, ryy y)
{
  return x.h > y.h;
}
int main()
{
  int n;
  cin >> n;
  f = c(n,2,1);
  for(int i=0; i<f; i++)
  {
    cin >> a[i].h;
    a[i].z = i;
  }
  sort(a,a+f,Sort);
  cout << a[f-2].z << endl;
  return 0;
}
2022/7/6 21:59
加载中...