將數組A中的內容和數組B中的內容進行交換。

1、解決方案 設計一個循環,對兩個數組同時依次遍歷,每變一次都執行交換操作,這樣遍歷結束就完成了數組的交換。 2、具體的交換方法的實現 void exchangeArray(int max, int* a, int* b)//exchange the two same size arrays, num is the size { //交換的實現 int temp = 0;
相關文章
相關標籤/搜索