|
|
back to boardInput at #9 (PASCAL ) 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.
|
|
|