为什么return有问题
查看原帖
为什么return有问题
1199910
luzhuohan楼主2024/6/23 11:15

DEV-C++ 显示return出来问题 具体为:

[Error] named return values are no longer supported

#include <bits/stdc++.h>

using namespace std;

int n,k;


bool cmp(int x,int y) return x < y;

int main(){
	int a[n] = {};
    cin >> n,k;
    
    for(int i = 0;i < n;i++){
        cin >> a[i];
    }
    
    sort(a+0,a+n,cmp);
    
    cout << a[k];
	return 0;
}
2024/6/23 11:15
加载中...