const n = 50; var i:byte; B:array[1..n] of word; procedure proc(A:array of word); begin for i:=1 to n do if((129 <= A[i]) and (A[i] <= 160)) or ((161 <= A[i]) and (A[i] <=175)) or ((225 <= A[i]) and (A[i] <= 242)) then Writeln('index = ',i+1,'; bukva - ''',char(A[i]),,' A[i] = ',A[i]); end;
Begin writeln; for i:=1 to n do B[i] := random(300); for i:=1 to n do Begin write(' ',i,' = ',B[i]); if (i mod 5 = 0) then writeln; end; writeln; writeln; proc(B); readln;
пример программы для паскаль
Program a;
const n = 50;
var
i:byte;
B:array[1..n] of word;
procedure proc(A:array of word);
begin
for i:=1 to n do
if((129 <= A[i]) and (A[i] <= 160)) or
((161 <= A[i]) and (A[i] <=175)) or
((225 <= A[i]) and (A[i] <= 242)) then
Writeln('index = ',i+1,'; bukva - ''',char(A[i]),,' A[i] = ',A[i]);
end;
Begin
writeln;
for i:=1 to n do
B[i] := random(300);
for i:=1 to n do Begin
write(' ',i,' = ',B[i]);
if (i mod 5 = 0) then writeln;
end;
writeln;
writeln;
proc(B);
readln;
end.
программа, выводящая на экран номер четверти координатной плоскости, которой принадлежит точка с координатами х≠0 и у≠0
program 198;
var x,y: real;
begin;
readln (x; y);
if x>0 and y>0 then
writeln (1 chetvert);
end;
if x<0 and y>0 then
writeln (2 chetvert);
end;
if x<0 and y<0 then
writeln (3 chetvert);
end;
if x>0 and y<0 then
writeln (4 chetvert);
end;
end.