【VC开源代码栏目提醒】:网学会员,鉴于大家对VC开源代码十分关注,论文会员在此为大家搜集整理了“Ex02_5a.cpp”一文,供大家参考学习!
#include <iostream.h>
void Swap(int a,int b); //声明函数
int main()//主函数
{
int x=2;
int y=10;
cout<<"x="<<x<<" y="<<y<<endl;
Swap(x,y);
cout<<"x="<<x<<" y="<<y<<endl;
return 0;
}
void Swap(int a,int b)
{
int t;
t=a;
a=b;
b=t;
}