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 |
各,各,各位大侠请,请,请帮我看,看,看下这个程序,多,多,多谢。请说明问题出在哪,最好能给几个反例。 Var i,j,k,m,n,code:Integer; t1:Byte; t2:String; s:Array [1..101] Of String; t:Array [1..101] Of Byte; Begin Readln(n,m); Fillchar(t,Sizeof(t),0); For i:=1 To m Do Begin Readln(s[i]); For j:=1 To n-1 Do For k:=j+1 To n Do If Ord(s[i][j])>Ord(s[i][k]) Then t[i]:=t[i]+1 End; For i:=1 To m-1 Do Begin For j:=i+1 To m Do If t[i]>t[j] Then Begin t1:=t[i]; t[i]:=t[j]; t[j]:=t1; t2:=s[i]; s[i]:=s[j]; s[j]:=t2 End End; For i:=1 To m Do Writeln(s[i]) End. O(∩_∩)O谢了 Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator