/*
对数组元素排序 再对数组排序
*/
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n;
//创建n个数组
vector<vector<int>> array(n);
//添加数据
for ( int i = 0; i < n; i++ ) {
int x;
cin >> x;
//根据x调整数组大小 用resize()
array[i].resize(x);
//输入
for ( int j = 0; j < x; j++ ) {
cin >> array[i][j];
}
//数组元素排序
sort(array[i].begin() , array[i].end());
}
//输出
for ( int i = 0; i < n; i++ ) {
//数组排序
sort(array.begin() , array.end());
//输出
for ( size_t j = 0; j < array[i].size(); j++ ) {
cout << array[i][j] << " ";
}
//换行
cout << endl;
}
return 0;
}
0 回复
0 转发
0 喜欢
7 阅读



