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 |
Re:再借地方用一下。^_^In Reply To:Re:再借地方用一下。^_^ Posted by:ass at 2003-12-03 22:41:40 #include "math.h" #include "stdio.h" void main() { char a[10]; int n,i,j,c; scanf("%d\n",&n); for (i=0;i<n;i++) { a[i]=getchar(); } for (i=0;i<n-1;i++) { c=i; for (j=i+1;j<n;j++) { if (a[j]<a[i]) c=j; } printf("%c",a[c]); a[c]=a[i]; } printf("%c\n",a[n-1]); } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator