' Basic консольное Dim x As Double, y As Double, z As Double, a As Double, b As Double a = 1.1 x = 0.2 b = 0.004 z = sin((x * x) + a) - sqr(x / b) y = (x * x) / a + cos(x + b) ^ 3 Print "z = "; z Print "y = "; y
' Visual Basic 2015 с формами Dim x As Double, y As Double, z As Double, a As Double, b As Double a = 1.1 x = 0.2 b = 0.004 z = Math.Sin((x * x) + a) - Math.Sqrt(x / b) y = (x * x) / a + Math.Cos(x + b) ^ 3 Label1.Text = "z = " + z.ToString Label2.Text = "y = " + y.ToString
procedure CountNegativeAndSumOdds(var M: Matrix); var q, w, CountNegative, SumOdds: integer; begin CountNegative := 0; SumOdds := 0; for q := 1 to 4 do begin for w := 1 to 3 do begin if M[q, w] < 0 then Inc(CountNegative); if (M[q, w] mod 2 <> 0) then SumOdds := SumOdds + M[q, w]; write(M[q, w]:4); end; writeln; end; writeln('Количество отрицательных = ', CountNegative); writeln('Сумма нечетных = ', SumOdds); end;
VAR A: Matrix; i, j: byte; BEGIN randomize; for i := 1 to 4 do for j := 1 to 3 do A[i, j] := random(101)-50; CountNegativeAndSumOdds(A); readln; END.
Dim x As Double, y As Double, z As Double, a As Double, b As Double
a = 1.1
x = 0.2
b = 0.004
z = sin((x * x) + a) - sqr(x / b)
y = (x * x) / a + cos(x + b) ^ 3
Print "z = "; z
Print "y = "; y
' Visual Basic 2015 с формами
Dim x As Double, y As Double, z As Double, a As Double, b As Double
a = 1.1
x = 0.2
b = 0.004
z = Math.Sin((x * x) + a) - Math.Sqrt(x / b)
y = (x * x) / a + Math.Cos(x + b) ^ 3
Label1.Text = "z = " + z.ToString
Label2.Text = "y = " + y.ToString
const NMAX = 4; MMAX = 3;
type Matrix = array[1..NMAX,1..MMAX] of integer;
procedure CountNegativeAndSumOdds(var M: Matrix);
var q, w, CountNegative, SumOdds: integer;
begin
CountNegative := 0; SumOdds := 0;
for q := 1 to 4 do
begin
for w := 1 to 3 do
begin
if M[q, w] < 0 then Inc(CountNegative);
if (M[q, w] mod 2 <> 0) then SumOdds := SumOdds + M[q, w];
write(M[q, w]:4);
end;
writeln;
end;
writeln('Количество отрицательных = ', CountNegative);
writeln('Сумма нечетных = ', SumOdds);
end;
VAR
A: Matrix;
i, j: byte;
BEGIN
randomize;
for i := 1 to 4 do
for j := 1 to 3 do A[i, j] := random(101)-50;
CountNegativeAndSumOdds(A);
readln;
END.