📄 34.c
字号:
#include<stdio.h>
void AchangB()//利用指针比较两个数的大小,并进行交换,按从小到大的顺序输出
{
void swap(int *x,int *y);
int a,b,*p1,*p2;
p1=&a;
p2=&b;
scanf("%d,%d",&a,&b);
if(a>b)
swap(p1,p2);
printf("a=%d,b=%d\n",a,b);
printf("*p1=%d,*p2=%d\n",*p1,*p2);
}
void swap(int *x,int *y)
{
int t;
t=*x;
*x=*y;
*y=t;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -