输入三个整数x,y,z,请把这三个数由小到大输出。
c语言吧
全部回复
仅看楼主
level 1
woaiwo_jia 楼主
http://www.chinahop.cn/Article/ShowArticle.asp?ArticleID=7879
2007年04月18日 04点04分 1
level 2
汗!我刚自学c几天的都觉得这题简单main() ?<(这手机打不出大括号用<代替) ?int x,y,z;?scanf("%d%d%d",&x,&y,&z);?if y>z ?y=z;?if x>y?x=y; ?printf("%x<%y<%z",x,y,z) ?>?我在校的高二学生,有错希望大家能提出哦,交友
2007年04月18日 05点04分 2
level 0
好象不对吧  呵呵!!
2007年04月18日 06点04分 3
level 0
好象不对吧  呵呵!!
2007年04月18日 06点04分 4
level 1
还不错,顶
2007年04月18日 07点04分 5
level 2
格式肯定不对.我手机上的.我手机垃圾.很多符号打不了!只是算法和语句有错吗?
2007年04月18日 07点04分 6
level 0
建议多申请一个变量...能花得了多少内存啊???
2007年04月18日 11点04分 7
level 1
dddd
2007年04月18日 12点04分 9
level 1
好 顶!
2007年04月18日 13点04分 10
level 1
d
2007年04月19日 03点04分 11
level 1
d
2007年04月19日 06点04分 12
level 1
我昏、这也叫好 方法有N种啊```加群7837345 我教你
2007年04月19日 07点04分 13
level 1
#include
void main(){int x,y,z,leap;printf("请输入三个数\n");scanf("%d%d%d",&x,&y,&z);if(x>y){leap=x;x=y;y=leap;}if(x>z){leap=x;x=z;z=leap;}if(y>z){leap=y;y=z;z=leap;}printf("%d %d %d",z,y,x);}
2007年04月19日 07点04分 14
level 1
#include
void main(){void sort(int x[],int n);int *p,i,a[10];p=a;for(i=0;i<10;i++)scanf("%d",p++);p=a;sort(a,10);for(p=a,i=0;i<10;i++){printf("%3d",*p);p++;}} void sort(int x[],int n) { int i,j,k,temp; for(i=0;i
x[j]) k=j; if(k!=i) { temp=x[i];x[i]=x[k];x[k]=temp; } } }这 是10 个数的排序
2007年04月19日 08点04分 15
level 2
郁闷了,这c吧不是很有前途啊,其实我做的是错的,如果我的if条件语句是真的话那就丢失了较大的数了,正确输出的也就只有最小数了!(怎么就没人指出我这如此大的错误呢? :-( )
2007年04月19日 08点04分 16
level 1
#include
void main(){int i,j,k,temp,a[10];for(i=0;i<10;i++)scanf("%d",&a[i]);for(i=0;i<9;i++)for(j=0;j<9-i;j++){if(a[j]>a[j+1]){temp=a[j];a[j]=a[j+1];a[j+1]=temp;}}for(i=0;i<10;i++)printf("%3d",a[i]);}
2007年04月19日 08点04分 17
level 1
2楼的算法只能把3个数的最大数求出来啊`
2007年04月19日 08点04分 18
level 0
#include"stdio.h"void main(){int a,b,c,t; printf("Please input 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); getch();}有你们那么复杂的吗????????怎么都出来误人子弟呢??FOR都用上了啊!!!!气死我了!!!要是我教的学生这样写啊!我非打断他的腿!!!!
2007年04月19日 08点04分 19
在VC++6.0里面最后的那个getch()会报错,应该改为getchar();但难掩这个程序的光芒啊![Yeah]
2012年11月03日 16点11分
真搞笑,看看十四楼的。别把无知当个性!
2012年11月04日 01点11分
不行吧这个
2013年05月18日 10点05分
level 1
d
2007年04月19日 09点04分 20
level 0
顶19楼的
2007年04月19日 10点04分 21
你试过吗
2013年05月18日 10点05分
1 2 3 4 尾页