code.club
標題:
陣列計算公式
[打印本頁]
作者:
enter
時間:
2016-4-2 02:17
標題:
陣列計算公式
有一個二維陣列,a[m][n],則其a[x][y]為第 x*n+(y+1) 個元素。
int a[5][7]={{1,2,3,3,5,6,7},{8,9,10,11,12,13,14},{15,16,17,18,19,20,21},{22,23,24,25,26,27,28},{29,30,31,32,33,34,35}};
cout<<a[4][6];
x*n+(y+1)
4*7+(6+1)=35
歡迎光臨 code.club (https://code.club/)
Powered by Discuz! X3.2