#include<iostream>
using namespace std;
int add(int sum1, int sum2) //void 调用
//这里面(add)要是把temp加进去的话 后面的也需要
{
cout << "交换前=" <<endl;
cout << sum1 << endl;
cout << sum2 << endl;
int temp = sum1;
sum1 = sum2; // 输出的话<< <<里面这能要有个变量要是有两个的话
//就会造成std无法识别具体是哪个
sum2 = temp;
cout << "交换后" << sum1 << endl;
cout<<sum2 << endl;
return temp;
}
int main() {
int a = 12;
int b = 15; //如果形参发生改变,并不会影响实参
add(a, b);
cout << a << b << endl;;
system("pause");
return 0;
}