Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
MxN 配列があり、以下に示すように、この配列を画像のように合計する必要があるとします。
配列合計
すべての x 、すべての y 、すべての z 、およびすべての g を合計する必要があります。アプローチが必要です。My_Brain.exe が停止し、この問題を解決する方法が見つかりませんでした。
SumColumnZigZag(column) { Sum = 0 for row = 0; row < rows; row++ { sum += array[row][column + (row % 2)*(1 - 2*(column % 2))] } return sum }
% はモジュロ演算子です