返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {  
  6.     re:
  7.     int x, y, tmp;
  8.     cout<<"Please enter a number: ";
  9.     cin>>x;
  10.     cout<<"Please enter another number: ";
  11.     cin>>y;
  12.     cout<<"Before the change"<<endl;
  13.     cout<<"x= "<<x<<" y= "<<y<<endl;
  14.     tmp=x;
  15.     x=y;
  16.     y=tmp;
  17.     cout<<"After the change"<<endl;
  18.     cout<<"x= "<<x<<" y= "<<y<<endl;
  19.     goto re;
  20.     return 0;   
  21. }
複製代碼

TOP

返回列表