|
|||||||
|
Главная » Фотоальбом » Примеры » БС if repeat for case БС if repeat for case
Блок-схема для программы
program str1; Var s: string; c, cnew: char; f: boolean; i, k, max: integer; begin s:=''; max:=0; k:=0; f:=false; repeat read(c); s:=s+c; if f then {слово началось } if c in ['a'..'z','A'..'Z'] then k:=k+1 else begin if k>max then max:=k; f:=false end else {f=false} if c in ['a'..'z','A'..'Z'] then begin f:=true; k:=1 end until c='.'; writeln(s,max); for i:=1 to length(s) do begin cnew:=chr(ord(s)+max); case s of 'a'..'z': if cnew>'z' then write(chr(ord(cnew)-26)) else write(cnew); 'A'..'Z': if cnew>'Z' then write(chr(ord(cnew)-26)) else write(cnew); else write(s) end; end; readln; readln; end.
|
Copyright MyCorp © 2024 |