問題タブ [2d-vector]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
c++ - c ++各行の列の値で2dベクトルの行をソートする方法
目的: 2D ベクトルがあります。4列目の値で並べ替えたい。たとえば、このベクトルを並べ替えたい:
行内の要素の位置は変更されませんが、ベクトル内の行の位置が変更され、4 列目の要素が次の順序になるように、4 列目の値で行を並べ替えます。
私は sort() を使用する必要があると想定していますが、オンラインで検索した後でも、これを行う方法がまったくわからないので、コードに関する直接的なヘルプや、Web サイトやリソースへの指示さえあれば、本当に感謝しています. ありがとう!