簡化代碼版
#include<iostream>
using namespace std;
void fun(int &a, int&b)
{
int c = 0;
c = a;
a = b;
b = c;
}
int main(void)
{
int x = 10;
int y = 20;
fun(x,y);
cout << x << "," << y << endl;
system("pause");
return 0;
}
#include<iostream>
using namespace std;
void fun(int &a, int&b)
{
int c = 0;
c = a;
a = b;
b = c;
}
int main(void)
{
int x = 10;
int y = 20;
fun(x,y);
cout << x << "," << y << endl;
system("pause");
return 0;
}
2019-10-04
舉報
2019-10-14
int main(void)
{
int x = 10;
int y = 20;
cout << y << "," << x << endl;
system("pause");
return 0;
}