Private Sub Command1_Click() mx = f(-4) mn = f(-4): kmn = -4 For i = -4 To 4 If mx < f(i) Then mx = f(i) If mn > f(i) Then mn = f(i): kmn = i End If Next i MsgBox "y(max)=" & mx & vbCr & "x_y(min)=" & kmn, vbInformation End Sub Function f(x) f=((X+1)/(x ^ 2 - 2)) ^ (0.5/1) End Function На Visual basic
mx = f(-4)
mn = f(-4): kmn = -4
For i = -4 To 4
If mx < f(i) Then mx = f(i)
If mn > f(i) Then
mn = f(i): kmn = i
End If
Next i
MsgBox "y(max)=" & mx & vbCr & "x_y(min)=" & kmn, vbInformation
End Sub
Function f(x)
f=((X+1)/(x ^ 2 - 2)) ^ (0.5/1)
End Function
На Visual basic
a,i:integer;
z:real;
Begin
for i:=-8 to 8 do begin
z:=i;
z:=z/2;
Writeln( abs(z-2)+ abs(z+1))
end;
End.