*p2)SWAP(p1,p2);if(*p2>*p3)" />

输入三个数,按由小到大的顺序输出

更新时间:02-01 教程 由 初遇 分享

#include

{

inta,b,c,*p1=&a,*p2=&b,*p3=&c,*t;

printf("输入3个数:\n");

scanf("%d%d%d",&a,&b,&c);

if(*p1>*p2)

SWAP(p1,p2);

if(*p2>*p3)

SWAP(p2,p3);

if(*p1>*p2)

SWAP(p1,p2);

printf("从小到大的顺序为:\n%d%d%d\n",*p1,*p2,*p3);

return0;

}

声明:关于《输入三个数,按由小到大的顺序输出》以上内容仅供参考,若您的权利被侵害,请联系13825271@qq.com
本文网址:http://www.25820.com/tutorial/14_2274496.html