代码:
1 #include <iostream> 2 using namespace std; 3 int main() 4 { 5 int array[2]; 6 for (int i = 0; i < 2; i++) { 7 cin >> array[i]; 8 } 9 int temp = array[0]; 10 array[0] = array[1]; 11 array[1] = temp; 12 for (int i = 0; i < 2; i++) { 13 cout << array[i] << " " ; 14 } 15 return 0; 16 }
结果:
本文来自网络收集,不代表计算机技术网立场,如涉及侵权请联系管理员删除。
ctvol管理联系方式QQ:251552304
本文章地址:https://www.ctvol.com/c-cdevelopment/600926.html