Program WordsCounter(output); var str: string; i, count: integer; begin write('Сторка: '); readln(str); i := length(str); if i > 0 then begin count := 1; while i > 0 do begin if str[i] = ' ' then count := count + 1; i := i - 1; end; end else count := 0; writeln('Число слов: ', count); readln; end.
Var a:array[1..15] of integer; i:integer; begin for i:=1 to 15 do read(a[i]); for i:=15 downto 1 do write(a[i],' '); end.
var a:array[1..4,1..4] of integer; i,j,s:integer; begin for i:=1 to 4 do for j:=1 to 4 do begin read(a[i,j]); if i=j then s+=a[i,j]; end; for i:=1 to 4 do begin for j:=1 to 4 do write(a[i,j]:3); writeln; end; writeln(s); end.
var a:array[1..20] of integer; i,max:integer; begin for i:=1 to 20 do begin read(a[i]); if (a[i]>=100) and (a[i]<1000) and (a[i] mod 9 <> 0) and (a[i]>max) then max:=a[i]; end; if (max<>0) then writeln(max) else writeln('Не найдено'); end.
var str: string;
i, count: integer;
begin
write('Сторка: ');
readln(str);
i := length(str);
if i > 0 then begin
count := 1;
while i > 0 do begin
if str[i] = ' ' then
count := count + 1;
i := i - 1;
end;
end
else
count := 0;
writeln('Число слов: ', count);
readln;
end.
i:integer;
begin
for i:=1 to 15 do
read(a[i]);
for i:=15 downto 1 do
write(a[i],' ');
end.
var a:array[1..4,1..4] of integer;
i,j,s:integer;
begin
for i:=1 to 4 do
for j:=1 to 4 do begin
read(a[i,j]);
if i=j then s+=a[i,j];
end;
for i:=1 to 4 do begin
for j:=1 to 4 do
write(a[i,j]:3);
writeln;
end;
writeln(s);
end.
var a:array[1..20] of integer;
i,max:integer;
begin
for i:=1 to 20 do begin
read(a[i]);
if (a[i]>=100) and (a[i]<1000) and (a[i] mod 9 <> 0) and (a[i]>max) then max:=a[i];
end;
if (max<>0) then writeln(max)
else writeln('Не найдено');
end.