文章
34
粉丝
89
获赞
2
访问
19.2k
#include <iostream> #include<cstdio> #include<algorithm> #include<string> #include<vector> using namespace std; int main(){ int n ; cin >> n; int a[n]; for(int i = 0;i < n;i++){ cin >> a[i]; } sort(a,a+n); for(int i = 0;i < n;i++){ cout << a[i] << " " ; } cout << endl; int len = unique(a,a+n) - a; for(int i = 0;i < len;i++){ cout << a[i] << " " ; } cout << endl; }
登录后发布评论
暂无评论,来抢沙发