- 行优先
for(int i = 0; i < 行数; ++i)
for(int j = 0; j < 列数; ++j)
cout << data[i*列数+j] << endl;
- 列优先
for(int i = 0; i < 列数; ++i)
for(int j = 0; j < 行数; ++j)
cout << data[i*行数+j] << endl;
for(int i = 0; i < 行数; ++i)
for(int j = 0; j < 列数; ++j)
cout << data[i*列数+j] << endl;
for(int i = 0; i < 列数; ++i)
for(int j = 0; j < 行数; ++j)
cout << data[i*行数+j] << endl;
2779
1435
361

被折叠的 条评论
为什么被折叠?