代码
#include<iostream>
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<string>
#include<cctype>
#include<sstream>
#include<cstring>
#include<set>
using namespace std;
#define endl "\n"
struct stu {
int name , money;
};
struct comp {
bool operator()(stu a , stu b) {
return a.money > b.money ;
}
};
int main() {
set<stu , comp> s;
int n ;
cin >> n;
stu a[n];
for(int i = 0 ; i < n ; i++) {
cin >> a[i].name >> a[i].money;
s.insert(a[i]);
}
map<Poker,int,Comp>::iterator it;
for(it = s.begin(); i != s.end() ; it++) {
if() {
}
}
return 0;
}
如何将set中的stu数组输出?
蒟蒻求助