关于set输出(请忽略头文件)
  • 板块学术版
  • 楼主ysomething
  • 当前回复11
  • 已保存回复11
  • 发布时间2020/6/20 11:58
  • 上次更新2023/11/7 00:20:32
查看原帖
关于set输出(请忽略头文件)
325230
ysomething楼主2020/6/20 11:58

代码

#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数组输出? 蒟蒻求助

2020/6/20 11:58
加载中...