?? 35.c
字號:
#include<stdio.h>
extern void swap(int *x1,int *x2);
void swap1(int *x1,int *x2,int *x3);
//void swap0(int *x1,int *x2);
void ABCchang()//利用指針比較三個數的大小,并進行交換,按從小到大的順序輸出
{
int a,b,c,*p1,*p2,*p3;
p1=&a;p2=&b;p3=&c;
printf("enter three number:\n");
scanf("%d,%d,%d",&a,&b,&c);
swap1(p1,p2,p3);
printf("a=%d,b=%d,c=%d\n",a,b,c);
printf("*p1=%d,*p2=%d,*p3=%d\n",*p1,*p2,*p3);
}
void swap1(int *x1,int *x2,int *x3)
{
if(*x1>*x2)
swap(x1,x2);
if(*x1>*x3)
swap(x1,x3);
if(*x2>*x3)
swap(x2,x3);
}
/*void swap0(int *x,int *y)
{
int t;
t=*x;
*x=*y;
*y=t;
}*/
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -