由键盘输入3个数,编写一程序将这3个数按由小到大的顺序输出

[复制链接]
查看11 | 回复0 | 2020-3-2 03:15:46 | 显示全部楼层 |阅读模式
#includevoidmain(){inta,b,c,temp;printf("Inputthreenumber:");scanf("%d%d%d",&a,&b,&c);if(b<a){temp=a;a=b;b=temp;}if(cvoid main(){ int a,b,c,temp; printf("Input three number:"); scanf("%d %d %d",&a,&b,&c); if(b<a){ temp=a;a=b;b=temp; } if(c<b) { temp=b;b=c;c=temp; } if(b<a){ temp=a;a=b;b=temp; } printf("%d %d %d\n",a,b,c);}试试看!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行