program raf105;
var a:array[1..30,1..20] of string;
i,j,o:integer;
s:string;
begin
for i:=1 to 30 do
for j:=1 to 20 do
a[i,j]:= '';
writeln('Вводите слова по очереди');
writeln('Чтобы закончить введите 0');
repeat
readln(s);
if s <> '0'
then
o:= o+1;
for i:=1 to length(s) do
a[o,i]:= s[i];
end;
until s = '0';
writeln;
writeln('Вывод:');
for i:=1 to o do
if a[i,j] = 'а'
then a[i,j]:= 'о';
if j <> 1
a[i,1]:= a[i,1] + a[i,j];
writeln(a[i,1]);
end.
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
program raf105;
var a:array[1..30,1..20] of string;
i,j,o:integer;
s:string;
begin
for i:=1 to 30 do
for j:=1 to 20 do
a[i,j]:= '';
writeln('Вводите слова по очереди');
writeln('Чтобы закончить введите 0');
repeat
readln(s);
if s <> '0'
then
begin
o:= o+1;
for i:=1 to length(s) do
a[o,i]:= s[i];
end;
until s = '0';
writeln;
writeln('Вывод:');
for i:=1 to o do
begin
for j:=1 to 20 do
if a[i,j] = 'а'
then a[i,j]:= 'о';
for j:=1 to 20 do
if j <> 1
then
begin
a[i,1]:= a[i,1] + a[i,j];
a[i,j]:= '';
end;
writeln(a[i,1]);
end;
end.