#include <stdio.h>
void swap(int *a,int *b)
{
int tmp;
tmp=*a;
*a=*b;
*b=tmp;
}
int main()
{
int a=20;
int b=10;
swap(&a,&b);
printf("a=%d b=%d",a,b);
return 0;
}使用函数实现两个数的交换。
原创安下 ©著作权
文章标签 使用函数实现两个数的交换。 文章分类 C/C++ 后端开发
-
Shell概述、编写及执行脚本、Shell变量
shell基础
Shell bash vim -
shell中如何进行一段代码的注释
在shell编程中,我们常常需要把一些语句注释掉,让它不执行,对单号或
shell脚本 不执行 shell编程 -
如何交换两个变量的值
不浪费额外空间交换数值的四种方法
i++ 空间复杂度 ios
















