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 |
What is wrong with it>?program fd; type DNAStr=Record s:integer; ch:string[100]; end; var k,p,m,n,a:integer; dna:array [1..50] of DNAStr; procedure quicksort(s,t:integer); var x:dnaStr; i,j:integer; Begin x:=dna[s]; i:=s; j:=t; While j>i do begin while (dna[j].s>=x.s)and(j>i) do j:=j-1; if j>i then begin dna[i]:=dna[j]; i:=i+1; end; while (dna[i].s<=x.s)and(i<j) do i:=i+1; if i<j then begin dna[j]:=dna[i]; j:=j-1; end; dna[i]:=x; end; if s<i-1 then quicksort(s,i-1); if t>i+1 then quicksort(i+1,t); end; begin fillchar(dna,sizeof(dna),0); readln(m,n); for k:=1 to n do readln(dna[k].ch); for k:=1 to n do for a:=0 to m-1 do for p:=a+1 to m do if ord(dna[k].ch[a])>ord(dna[k].ch[p]) then dna[k].s:=dna[k].s+1; quicksort(1,n); for k:=1 to n do writeln(dna[k].ch); end. Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator