#include <stdio.h>
int main()
{//整数按从小到大排列,不破坏原数值
void swap(int *p1,int *p2); //申明swap函数
int a,b; //定义初始变量
int *pointer_1,*pointer_2; //定义两个指针变量
printf("please enter a and b:\n");
scanf("%d,%d",&a,&b); //将输入的两个常数赋值给初试变量a ,b
pointer_1 = &a;
pointer_2 = &b;
if (a>b)swap(pointer_1,pointer_2);
printf("min = %d,max = %d\n",b,a);
printf("max = %d,min = %d",*pointer_1,*pointer_2);
return 0;
}
void swap(int *p1,int *p2)
{
int p;
p = *p1;
*p1 =*p2;
*p2 = p;
}
慕的地6079101
吴邪Cc
氵5
精慕门1091730
张幼安
慕前端4312548
wDan_9527