#include<stdio.h>
int main()
{
void swap(int* p1, int* p2);
int a, b, c;
printf("Please input three integers: ");
scanf_s("%d%d%d", &a, &b, &c);
swap(&a, &b);
swap(&a, &c);
swap(&b, &c);
printf("The ascending order is %d %d %d\n", a, b, c);
return 0;
}
void swap(int* p1, int* p2)
{
if (*p1 > *p2) {int t = *p1;*p1 = *p2;*p2 = t;}
}
void swap(int*p1,int*p2)排序
最新推荐文章于 2024-07-16 23:19:20 发布