program AI; uses crt; var privet, deistv : integer; priv1, priv2, priv3 : text; s: string; procedure phrasal; var ph: text; c: string; begin clrscr; assign(ph,'phrasal.txt'); reset(ph); while not eof(ph) do begin readln(ph,c); writeln(c); readln; end; begin clrscr; assign(priv1,'1.txt'); reset(priv1);{Загружаем 1 вариант приветствия из файла} assign(priv2,'2.txt'); reset(priv2);{Загружаем 2 вариант приветствия из файла} assign(priv3,'3.txt'); reset(priv3);{То же самое для 3 варианта} randomize; privet:=random(4); case privet of 1: begin while not eof(priv1) do begin readln(priv1,s); writeln(s); readln(deistv); case deistv of 1: ph; end; end; readkey; end; 2: begin while not eof(priv2) do begin readln(priv2,s); writeln(s); case deistv of 1: ph; end; end; readkey; end; 3: begin while not eof(priv2) do begin readln(priv2,s); writeln(s); case deistv of 1: ph; end; end; readkey; end; 4: begin while not eof(priv2) do begin readln(priv2,s); writeln(s); case deistv of 1: ph; end; end; readkey; end; 0: begin while not eof(priv2) do begin readln(priv2,s); writeln(s); case deistv of 1: ph; end; end; readkey; end; end; end.