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 1601. AntiCAPS

Why I got WA 21 test.
Posted by AlexeyPechenin 7 Oct 2008 01:34
This is my code:

{$APPTYPE CONSOLE}
uses
  SysUtils;
var
   s: string;
   f: boolean;
   newstr: string;
   i: integer;

begin
 //assign(input, 'input.txt'); reset(input);
// assign(output, 'output.txt'); rewrite(output);

 f:=true;
  while not eof do
   begin
    readln(s);
    newstr:='';
    s:=LowerCase(s);
    // process

     for i:=1 to length(s) do
      begin
       if f and (s[i] <> ' ') and (s[i] <> ',') and (s[i] <> '!')
            and (s[i] <> '?') and (s[i] <> '.') then
       begin
        newstr:=newstr + UpCase(s[i]);
        f:= false;
       end
       else newstr:=newstr + s[i];

       if (s[i] = '?') or (s[i] = '!') or (s[i] = '.') then
             f:=true;
      end;
     writeln(newstr);
   end;

end.
Re: Why I got WA 21 test.
Posted by me 14 Oct 2008 23:27
i have got the same problem. Can anyoune help us?
Re: Why I got WA 21 test.
Posted by SochiX 14 Nov 2008 20:58
Anyone HELP ME! I have this problem tooo!
Re: Why I got WA 21 test.
Posted by DM^Dude (Kherson State University) 14 Mar 2009 20:41
In 21 test first symbol is not a letter.
May be it's help you
Re: Why I got WA 21 test.
Posted by Giga 31 Aug 2011 02:36
-AA.
-BB

Answer is

-Aa.
-Bb
Re: Why I got WA 21 test.
Posted by Jonathan Livingston 9 Oct 2011 19:17
Something more. There is possible situation:
- AAA.
- BBB
- CCC.
And coorect result is:
- Aaa.
- Bbb
- Ccc.
(Difference is in space after '-' and new line starts with upper cased char inspite of the fact, there was no any dot or ! or ? at the end of previous line)
So, if you'll ask me, I'll say that such conditions aren't fair.
Author should mention such details in condition, I suppose.
Re: Why I got WA 21 test.
Posted by vpro 29 Jun 2012 22:15
DM^Dude (Kherson State University) wrote 14 March 2009 20:41
In 21 test first symbol is not a letter.
May be it's help you
Thank you. It's true.
Re: Why I got WA 21 test.
Posted by Plamen_N 8 Aug 2012 01:32
For this test case:
- AAA.
- BBB
- CCC.

my accepted program gives:
- Aaa.
- Bbb
- ccc.