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

Input at #9 (PASCAL )
Posted by Gorgan Razvan 28 Sep 2011 21:59
 Hello. My program fails at test 9. Can you tell me please the input so I can correct my algorithm?
 Here's my program too :) :

 program sms;
var i,j:integer;punct:boolean;ch:array[1..20000] of char;
begin
 i := 0;
 while not eof() do
 begin
  i := i + 1;
  read(ch[i]);
 end;
 punct := true;
 j := 1;
 while j <= i do
 begin
  while (ch[j] < 'A') or (ch[j] > 'Z') do
  j := j + 1;
  if not punct then ch[j] := chr(ord(ch[j]) + 32);
  j := j + 1;
  punct := false;
  if (ch[j] = '.') or (ch[j] = '!') or (ch[j] = '?') then punct := true;
 end;
 for j := 1 to i do
 write(ch[j]);
readln;
end.