ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1723. Sandro's Book

Where wrong??H..E..L..P (pascal)
Posted by xuanzebin 27 Jan 2011 12:39
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"