sydm.net
当前位置:首页>>关于C语言题 输入三个数,分别按照从小到大和从大到小的...的资料>>

C语言题 输入三个数,分别按照从小到大和从大到小的...

#include void main() { int a,b,c,temp; printf("输入三个数"); scanf("%d%d%d",&a,&b,&c); if(a

#include void main() { int a,b,c; int d,e,f,sum; printf("请输入三个整数:\n"); scanf("%d,%d,%d",&a,&b,&c); //分号放错位置了 sum=a+b+c; d=(a>=b)? a:b; d=(d>=c)? d:c; e=(a

#include main() {int a,b,c,t; printf("input three number please;"); scanf("%d,%d,%d",&a,&b,&c); if (a>b) { t=b;b=a;a=t;} if (a>c) {t=c;c=a;a=t;} if (b>c) { t=c;c=b;b=t;}//对三个数进行简单的排序 printf("%d,%d,%d",a,b,c); } //编...

#include int main(){ int s=0,a,b,c; scanf("%d%d%d",&a,&b,&c); if(a>b) { s=a; a=b; b=s; } if(a>c) { s=a; a=c; c=s; }if(b>c) { s=b; b=c; c=s; } printf("%d\t%d\t%d\n",a,b,c); getchar(); getchar(); return 0;}

#include void main() { int a,b,c,temp; printf("please input a,b,c:"); scanf("%d%d%d",&a,&b,&c); if(a>b) { temp=a;a=b;b=temp; } if(b>c) { temp=b;b=c;c=temp; } if(a>c) { temp=a;a=c;c=temp; } printf("%d %d %d\n",a,b,c); } 请你拿到...

#includevoid main(){int a,b,c,t;printf("请输入三个整数:a b c\n");scanf("%d%d%d",&a,&b,&c);if(a>b){t=a;a=b;b=t;}if(a>c){t=a;a=c;c=t;}if(b>c){t=b;b=c;c=t;}printf("排序后的三个整数为:%d,%d,%d\n",a,b,c);}

输入三个整数,要求按从小到大的顺序输出。解题思路:此题采用依次比较的方法排出其大小顺序。 #include main() {int a,b,c,t; printf("input three number please;"); scanf("%d,%d,%d",&a,&b,&c); if (a>b) { t=b;b=a;a=t;} if (a>c) {t=c;c=a...

代码1. // 输入3个数,要求按从小到大顺序输出 #include int main() { int a,b,c,t; printf("请输入三个数:"); scanf("%d%d%d",&a,&b,&c); if(a > b) { t = a; a = b; b = t; } if(a > c) { t = a; a = c; c = t; } if(b > c) { t = b; b = c; ...

#include void main() { int a,b,c,i,tmp; printf("请输入三个数:"); scanf("%d%d%d", &a, &b, &c); for(i=0;ib) { tmp=a;a=b; b=tmp; } if (b>c) { tmp=b;b=c; c=tmp; } } printf("%d%d%d", a, b, c); }

#includevoid main() { int x,y,z,a; char s[4]={ "xyz" },c; scanf("%d%d%d",&x,&y,&z); if ( x>y ) { b=x;x=y;y=b; c=s[0];s[0]=s[1];s[1]=c; } if ( x>z ) { b=x;x=z;z=b; c=s[0];s[0]=s[2];s[2]=c; } if ( y>z ) { b=y;y=z;z=b; c=s[1];s[1]...

网站首页 | 网站地图
All rights reserved Powered by www.sydm.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com