返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.      re:
  7.      system("cls");
  8.      int x, y, tmp;
  9.      cout<<"請依序輸入個正整數: ";
  10.      cin>>x>>y;
  11.      cout<<"對調前x="<<x<<" y="<<y<<endl;
  12.      tmp=x;
  13.      x=y;
  14.      y=tmp;
  15.      cout<<"對調前x="<<x<<"y="<<y<<endl;
  16.      system("pause");
  17.      goto re;
  18.      return 0;
  19. }
複製代碼

TOP

返回列表