C语言基础测试题关于给定任意俩个数对它们进行交换输出

来源:互联网 发布:网络好听的名字 编辑:程序博客网 时间:2024/06/07 00:05
#include<stdlib.h>
#include<stdio.h>
void swap(int *a,int *b)
{
int tmp=*a;
*a=*b;
*b=tmp;
}
int main()
{
int a=10;
int b=20;
swap(&a,&b);
printf("a=%d,b=%d\n",a,b);
system("pause");
return 0;
}
0 0
原创粉丝点击