c6-19.cpp

来自「清华大学谭浩强编写的C++程序设计的课本中的例子和课后习题的解答!」· C++ 代码 · 共 17 行

CPP
17
字号
#include <iostream>
using namespace std;
int main()
{void swap(int *,int *);
 int i=3,j=5;
 swap(&i,&j);
 cout<<i<<" "<<j<<endl;
 return 0;
}

void swap(int *p1,int *p2)
{int temp;
 temp=*p1;
 *p1=*p2;
 *p2=temp;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?