Ввести текст крупными буквами с некоторыми паузами между словами, сопровождая каждую буквозвуковым щелчком. Перенос осуществлять только целыми словами- Pascal(Паскаль)

uses
  crt,graph;
var
  i,j,len,lenst,m,k,len2: integer;
  st,word: string;
begin
  clrscr;
  write('Vvedite text: ');
  readln(st);
  i:=detect;
  j:=detect;
  InitGraph(i,j,'');
  i:=1;
  lenst:=0;
  m:=0;
  len:=0;
  SetTextStyle(0,0,6);
  while i<=length(st) do
  begin
    while (st[i]=' ') and (i<=length(st)) do
      inc(i);
    j:=i;
    while (st[i]<>' ') and (i<=length(st)) do
      inc(i);
    word:=copy(st,j,i-j);
    lenst:=lenst+len;
    len2:=TextWidth(word);
    if (lenst+len2+len)>GetMaxX then
    begin
      m:=m+50;
      lenst:=0;
      len:=0;
    end;
    for k:= 1 to length(word) do
    begin
      lenst:=lenst+len;
      len:=TextWidth(word[k]);
      OutTextXY(lenst,m,word[k]);
      Sound(131);
      Delay(50000);
      NoSound;
    end;
  end;
  readkey;
  closegraph;
end.

Leave a Comment

28 + = 37