?? 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 + -