- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main()
- {
- re:
- int x, y, tmp;
- cout<<"Please enter a number: ";
- cin>>x;
- cout<<"Please enter another number: ";
- cin>>y;
- cout<<"Before the change"<<endl;
- cout<<"x= "<<x<<" y= "<<y<<endl;
- tmp=x;
- x=y;
- y=tmp;
- cout<<"After the change"<<endl;
- cout<<"x= "<<x<<" y= "<<y<<endl;
- goto re;
- return 0;
- }
複製代碼 |