1 #include<iostream> 2 using namespace std; 3 int main() 4 { 5 int temp = 0; 6 int arr[6] = { 0,1,2,3,4,5 }; 7 8 for (int i = 0; i <= 6/2-1; i++) { 9 temp = arr[i]; 10 arr[i] = arr[5 - i]; 11 arr[5 - i] = temp; 12 } 13 14 for (int i = 0; i < 6; i++) { 15 cout << arr[i] << endl; 16 } 17 18 cout << endl; 19 system("pause"); 20 return 0; 21 }
标签:std,arr,int,元素,main,逆序 From: https://www.cnblogs.com/Sandals-little/p/16873473.html