返回列表 發帖
  1. #include<iostream>
  2. using namespace std;
  3. int main()
  4. {
  5.     int a, b,tmp;
  6.     cout<<"請輸入a和b: ";
  7.     cin>>a>>b;
  8.     cout<<"對調前:"<<"a="<<a<<"        b="<<b<<endl;
  9.     tmp=a;
  10.     a=b;
  11.     b=tmp;
  12.     cout<<"對調後:"<<"a="<<a<<"        b="<<b<<endl;
  13.     system("pause");
  14.     return 0;   
  15. }
複製代碼

TOP

返回列表