Program p1;
Uses crt;
Var A: array [1..10] of integer;
i,k: integer;
Begin clrscr;
Writeln ('Введите элементы массива');
for i:=1 to 10 do
read (a[i]);
k:=0;
for i:=1 to 10 do
begin
if (a[i]>10) and (a[i]<30) then
k:=k+1;
end;
writeln ('Количество чисел в диапазоне (10;30) =',k);
Readln;
readkey;
end.
// PascalABC.NET 3.1, сборка 1171 от 15.02.2016
var
n,d1,d2,d3:integer;
begin
Write('n='); Read(n);
d1:=n div 100; d3:= n mod 10;
d2:=(n div 10) mod 10;
if (d1=d2) or (d1=d3) or (d2=d3) then Writeln('Да')
else Writeln('Нет')
end.
<u><em>Тестовые решения:</em></u>
n=123
Нет
n=121
Да
n=222
Да
//1
var i: byte;
begin
for i := 2 to 20 do
writeln('Цена за ',i,' = ', 20.4 * i);
end.
//2
var i: byte;
Price, TotalPrice: real;
begin
Price := 20.4;
for i := 2 to 20 do
begin
TotalPrice := Price * i;
writeln('Цена за ',i,'шт. = ', TotalPrice);
end;
end.
Клетки - 6 букв.Я думаю так!
//PascalABC.NET 3.1 сборка 1219
procedure PrintMatrix(a: array[,] of integer);
begin
for var i := a.GetLowerBound(0) to a.GetUpperBound(0) do
begin
writeln;
for var j := a.GetLowerBound(1) to a.GetUpperBound(1) do
write(a[i, j], ' ');
end;
writeln;
end;
begin
var a := MatrixRandom(ReadInteger('n ='), ReadInteger('m ='), 0, 255);
PrintMatrix(a);
for var i := a.GetLowerBound(0) to (a.GetUpperBound(0) div 2) do
for var j := a.GetLowerBound(1) to a.GetUpperBound(1) do
swap(a[i, j], a[a.GetLowerBound(0) + a.GetUpperBound(0) - i, j]);
PrintMatrix(a);
end.