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 1094. E-screen

i think i misunder stand this problem!!
Posted by Bobur 20 Feb 2008 22:57
in example writen---
"Look for second hamburger at computer and chairs.790 "
there mustn't writen "790".
number of "<" is bigger than answer.
and why "790" in the end of sentence!!
pls, explain it to me!!!
thx!!!

and i think it is right!!
program Project1094;

{$APPTYPE CONSOLE}

uses
  SysUtils;

   var
    a : string[80];
    i, j : integer;
    ch : char;
    f, f1 : textfile;

begin
   assign(f, '1094.in');
   assign(f1, '1094.out');
   reset(f);
   rewrite(f1);
   i := 0;
   fillchar(a, sizeOf(a), 0);
   while not eof do
     begin
       read(ch);
       if ch = '>' then  begin
       if i < 80 then begin  inc(i);  a[i] := ' ';  end
       else i := 0;   end;

       if (ch = '<') and (i > 0) then dec(i);
       if (ch <> '<') and (ch <> '>') then  begin  inc(i);  a[i] := ch;  end;
     end;
     for j := 1 to i do
     write(a[j]);
   close(f);
   close(f1);

end.

Edited by author 20.02.2008 23:05