返回题解分享
讨论 / 题解分享/ 帖子详情

set的插入与遍历 - 题解

#include<bits/stdc++.h>  // 包含标准库头文件

using namespace std;    // 使用标准命名空间

int main(){
    set<int>se;
    int n,t;
    cin>>n;
    for(int i=0;i<n;i++){
		cin>>t;
		se.insert(t);
	}
	for(auto j : se){
		cout<<j<<' ';
	}
	return 0;
}
0 回复 0 转发 0 喜欢 9 阅读
回复 (0)
默认 最新
暂无回复,快来抢沙发!