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 1297. Palindrome

Problem of input!!! {Pascal}
Posted by 33687GH 18 Feb 2005 18:55
How can we read, not using CRT and ASM???
I have truest solution, but can not read more then 255 of char!!!
How can you read using CRT? :P
Posted by Vlad Veselov [PMG17,Vinnitsa - KNU,Kiev] 18 Feb 2005 19:16
Something like this:
Var A  : Array 0 .. 1000] Of Char;
    Ch : Char;
    L  : Word;
BEGIN
 L := 0;
 Read(Ch);
 While UpCase(Ch) In ['A'..'Z'] Do
  begin
   Inc(L);
   A[L] := Ch;
   Read(Ch);
  end;
 ...
END.
Re: How can you read using CRT? :P
Posted by 33687GH 18 Feb 2005 21:29
Try to test it for example with this:
'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff'
{More then 256!!! It will be ring!!! It input at first string, and then read chars, THAT IS THE MAIN PROBLEM}
Re: How can you read using CRT? :P
Posted by ronobe (aka oberon) 18 Feb 2005 21:33
p1. Change your name and motto. Your judge ID should be secret.
p2. When you compile program you obtain something like a.exe
then input file is redirected to your program.
a.exe < test.in
You won't get any ring, since ring occures only when you read via keyboard.
Re: How can you read using CRT? :P
Posted by 33687GH 18 Feb 2005 21:37
But I can not get AC without it!!!
Re: How can you read using CRT? :P
Posted by Vladimir Yakovlev (USU) 19 Feb 2005 01:50
Use {$H+} directive and you'll get huge strings.
Re: How can you read using CRT? :P
Posted by 33687GH 19 Feb 2005 14:55
Thank you very much!!!