sort,但是二维数组(
2024-06-22 13:29:46
发布于:广东
我爱发电
#include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;
int a[2][3] = {6, 5, 4, 3, 2, 1};
int main(){
sort(a[0], a[1] + 3);
for(int i = 0; i <= 1; i++){
for(int j = 0; j <= 2; j++){
cout << a[i][j] << ' ';
}
cout << endl;
}
}
全部评论 1
发电
2024-06-22 来自 广东
0
有帮助,赞一个