返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main(){
  5. int a,b,c;


  6. cout<<"請依序輸入兩個數: ";
  7. cin>>a>>b;
  8. cout<<"對調前:";
  9. cout<<"a="<<a<<",b="<<b<<endl;
  10. c=a;
  11. a=b;
  12. b=c;

  13. cout<<"對調後: ";
  14.     cout<<"a="<<a<<",b="<<b<<endl;


  15.     system("pause");
  16.     return 0;
  17. }
複製代碼

TOP

返回列表