1. Создать через оператор Dim 4 переменных: string, date, string, string. Например: Dim A as Double 2. Используя оператор For Next считать значения из ячеек через оператор Cells 3. И записать в строчку третью значение: А3, B3, C3, D3
Var i, j, k : integer; a : array [0..9,0..9] of char; procedure U(i,j:integer); var c : char; begin c:=a[i,j]; a[i,j]:=' '; if (c='W')and(a[i+1,j]='B') then U(i+1,j); if (c='B')and(a[i+1,j]='W') then U(i+1,j); if (c='W')and(a[i-1,j]='B') then U(i-1,j); if (c='B')and(a[i-1,j]='W') then U(i-1,j); if (c='W')and(a[i,j+1]='B') then U(i,j+1); if (c='B')and(a[i,j+1]='W') then U(i,j+1); if (c='W')and(a[i,j-1]='B') then U(i,j-1); if (c='B')and(a[i,j-1]='W') then U(i,j-1); end; begin assign(input,'input.txt'); reset(input); assign(output,'output.txt'); rewrite(output); for i:=1 to 8 do begin for j:=1 to 8 do read(a[i,j]); readln end; for i:=1 to 8 do begin a[0,i]:=' '; a[9,i]:=' '; a[i,0]:=' '; a[i,9]:=' ' end; k:=0; for i:=1 to 8 do for j:=1 to 8 do if a[i,j]<>' ' then begin k:=k+1; U(i,j) end; write(k); close(output) end.
var a:array[1..3, 1..4] of integer; i,j,min:integer; begin for i:=1 to 3 do for j:=1 to 4 do begin read(a[i,j]); if a[i,j]<0 then min:=a[i,j]; end; for i:=1 to 3 do for j:=1 to 4 do if (a[i,j]<0) and (a[i,j]<min) then min:=a[i,j]; writeln('Минимальное отрицательное число ',min); end.
Задача №2 var a:array[1..2, 1..5] of integer; i,j:integer; begin for i:=1 to 2 do for j:=1 to 5 do read(a[i,j]); for i:=1 to 2 do begin for j:=1 to 5 do write(a[i,j],' '); writeln; end; end.
Задача №3 var a:array[1..3, 1..4] of integer; i,j:integer; begin for i:=1 to 3 do for j:=1 to 4 do read(a[i,j]); for i:=1 to 3 do for j:=1 to 4 do if a[i,j]=10 then writeln('Номер столбца — ',j,' Номер строки — ',i); end.
i, j, k : integer;
a : array [0..9,0..9] of char;
procedure U(i,j:integer);
var c : char;
begin
c:=a[i,j]; a[i,j]:=' ';
if (c='W')and(a[i+1,j]='B') then U(i+1,j);
if (c='B')and(a[i+1,j]='W') then U(i+1,j);
if (c='W')and(a[i-1,j]='B') then U(i-1,j);
if (c='B')and(a[i-1,j]='W') then U(i-1,j);
if (c='W')and(a[i,j+1]='B') then U(i,j+1);
if (c='B')and(a[i,j+1]='W') then U(i,j+1);
if (c='W')and(a[i,j-1]='B') then U(i,j-1);
if (c='B')and(a[i,j-1]='W') then U(i,j-1);
end;
begin
assign(input,'input.txt');
reset(input);
assign(output,'output.txt');
rewrite(output);
for i:=1 to 8 do begin for j:=1 to 8 do
read(a[i,j]);
readln
end;
for i:=1 to 8 do
begin
a[0,i]:=' '; a[9,i]:=' '; a[i,0]:=' '; a[i,9]:=' '
end;
k:=0;
for i:=1 to 8 do
for j:=1 to 8 do
if a[i,j]<>' ' then
begin
k:=k+1; U(i,j)
end;
write(k);
close(output)
end.