|
|
- #include<iostream>
- using namespace std;
- void Change(int *X, int *Y)
- {
- int temp = *X ;
- *X = *Y ;
- *Y = temp ;
- }
- int main()
- {
- int X=0,Y=0;
-
- cout << "X = " ;
- cin >> X ;
- cout << "Y = " ;
- cin >> Y ;
- cout << endl ;
-
- Change(&X,&Y);
- cout << "X = " << X << endl << "Y = " << Y ;
- cout << endl ;
-
- system("PAUSE");
- return 0 ;
- }
複製代碼 |
|