|
|
back to boardWhere wrong??H..E..L..P (pascal) program sdf; var i,j,k,l,n,m,max:longint; a:array[1..58]of longint; str,str1:ansistring; begin //while not eof do begin readln(str); for i:=1 to length(str) do inc(a[ord(str[i])-64]); max:=0; for i:=1 to 58 do if max<a[i] then max:=a[i]; for i:=1 to length(str) do if a[ord(str[i])-64]=max then begin write(str[i]); a[ord(str[i])-64]:=-1; end; writeln; //end; end. Re: Where wrong??H..E..L..P (pascal) Posted by Evgeny 22 Sep 2011 18:26 May be all elements of array a should be equals by zero? Edited by author 22.09.2011 18:26 Edited by author 22.09.2011 18:27 Re: Where wrong??H..E..L..P (pascal) Posted by Evgeny 22 Sep 2011 18:48 test for you: "tebidoghtebidoh" |
|
|