爱丁顿数
作者:互联网
题源
题解
#include <iostream>
#include <algorithm>
using namespace std;
int a[1000000];
bool cmp1(int a, int b) {
return a > b;
}
int main() {
int n;
scanf("%d", &n);
int i = 0;
for(i = 1; i <= n; i++) scanf("%d", &a[i]);
sort(a+1, a+n+1, cmp1);
int p = 0;
for (i = 0,p = 1; i < n && a[p] > p;i++,p++);
printf("%d", i);
getchar();getchar();
return 0;
}
标签:return,int,题解,爱丁顿,++,include,getchar 来源: https://blog.csdn.net/Fake_God/article/details/116231506