本帖最後由 葉桔良 於 2022-11-19 20:19 編輯
- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main()
- {
- int x,y,tmp;
- cout<<"請依序輸入兩個正整數: ";
- cin>>x>>y;
- cout<<"對調前: ";
- cout<<"x="<<x<<" y="<<y<<endl<<endl;
-
- ...
-
- cout<<"對調後: ";
- cout<<"x="<<x<<" y="<<y<<endl<<endl;
-
- system("pause");
- return 0;
- }
複製代碼 |