C ++数组值排序 [英] C++ array value sorting

查看:147
本文介绍了C ++数组值排序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我想第二个维度的一样,0元素进行排序:

If I want to sort the second dimension's 0 element like that:

short arr[5];

arr[0][0] = 122;
arr[0][1] = 33;
arr[0][2] = 45;

arr[1][0] = 33;
arr[1][1] = 12;
arr[1][2] = 42;
.
.
.

这将排序改编[I] [0] ,但改编[I] [1] 改编[I] [2] 将带着改编[I] [0] 来一个新元素。

It will sort arr[i][0], but arr[i][1] and arr[i][2] will come with arr[i][0] to a new element.

推荐答案

这应该可以帮助你:
http://www.cplusplus.com/reference/algorithm/sort/

这篇关于C ++数组值排序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆