Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program poem;
- var
- s: string;
- i: integer;
- begin
- writeln ('Enter a spoiled poem (supposed to be typed in Latin)');
- readln (s); //input
- for i := 1 to length (s) do begin //checking each character in the string
- if (ord (s[i]) in [97..122]) then //if the letter is a lowercase letter then write this letter without changes
- write (s[i])
- else if (ord (s[i]) in [65..90]) then begin //if the letter is a capital letter then we are going to the next line and writing this letter
- writeln;
- write (s[i]);
- end
- else if (ord (s[i]) = 32) then //if the character is space then we write the space
- write (' ');
- end;
- readln;
- readln;
- end.
RAW Paste Data