Я думаю это запах ....))))))))
Program project1;
var
x,A: integer;
begin
write('x:');
readln(x);
if (x>=-7) and (x<=7) then
A:=15
else
A:=5;
writeln(A);
readln;
end.
Var
a: array [,] of integer;
begin
var n := ReadlnInteger('n = ');
var m := ReadlnInteger('m = ');
var rand := ReadlnInteger('Для ручного ввода нажмите 0');
if rand = 0 then begin
a := new integer[m, n];
for var i := 0 to m-1 do
for var j := 0 to n-1 do
a[i, j] := ReadlnInteger('a[' + i + ',' + j + '] = ');
end
else a := MatrixRandom(m, n, 1, 100);
Println(a);
var b := ArrGen(n, x -> 1);
for var i := 0 to m-1 do
for var j := 0 to n-1 do
if j mod 2 = 0 then
b[j] := b[j] * a[i, j];
b.Where((x, i)-> i mod 2 = 0).SortedDescending().Println();
end.
Код Pascal:
Const
n = 13;
Type
Mass = array[1..n] of real;
Function KL(Var A:Mass; c:real):integer;
Var
k,i:integer;
Begin
k:=0;
For i:= 1 to n do
if A[i] > c then k:=k+1;
KL:=k;
End;
Var
A:Mass;
i:integer;
c:real;
Begin
Randomize;
Write('A(',n,'):');
For i:= 1 to n do
Begin
A[i]:=random*21-10;
Write(' ',A[i]:0:3);
End;
WriteLn;
Write('c = ');ReadLn(c);
WriteLn('k = ',KL(A,c))
End.
Пример работы программы:
A(13): -2.768 10.516 -3.518 9.286 5.555 1.039 1.225 -6.135 8.743 7.440 -3.979 6.129 -7.982
c = 3
k = 6
1)
var
a, b:real;
begin
write('Катет A = ');
readln(a);
write('Катет B = ');
readln(b);
writeln('Гипотенуза = ', sqrt(sqr(a)+sqr(b)));
end.
2)
var
a, b:integer;
begin
write('a = ');
readln(a);
write('b = ');
readln(b);
if a=b then writeln('Сумма a и b = ',a+b)
else writeln('Произведение a и b = ',a*b);
end.
3)
var
a, b, c, D, x1, x2: real;
begin
write('Коэффицент A = ');
readln(a);
write('Коэффицент B = ');
readln(b);
write('Коэффицент C = ');
readln(c);
D := sqr(b) - (4 * a * c);
if D > 0 then begin
x1 := (-(sqrt(D)) - b) / (2 * a);
x2 := (sqrt(D) - b) / (2 * a);
writeln('x1 = ', x1);
writeln('x2 = ', x2);
end
else if D = 0 then begin
x1 := -b / 2 * a;
writeln('x = ', x1);
end;
if D < 0 then writeln('Корней нет.');
end.