Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
翻书,翻书去In Reply To:Re:ft,那个确实不是冒泡啊,刚才一直纳闷他怎么错了,居然是我看错了 Posted by:hubo430 at 2005-06-09 16:58:18 > 冒泡是不是该这样写啊: > for(i=0;i<=num-2;i++) > {k=i;min=b[i]; > for(j=i+1;j<=num-1;j++) if(min>b[j]) {min=b[j];k=j;} > if(k!=i){strcpy(c,a[i]);strcpy(a[i],a[k]);strcpy(a[k],c);e=b[i];b[i]=b[k];b[k]=e;} > } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator