Iceman82
Junior Member | Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору 1. Код: program first; uses crt; var num, denum, y, x : real; begin clrscr; write('Vvedite x: '); readln(x); if x <> 0 then begin num := exp(ln(ln(x) - 0.85*exp(0.1*ln(x)))/3); denum := exp((-x)*ln(3)) + ln(abs(sin(2*x))); y := num / denum; writeln('Resultat y = ',y) end else writeln('Error: x cannot be a zero!'); readkey; end. | 2. Код: program second; uses crt; const a = 2; b = 15; var x, y : real; begin clrscr; write('Input x: '); readln(x); if (x >= 2) and (x <= 15) then begin if x <= 5 then y := 1/cos(x) else if (x > 5) and (x < 8) then y := 2*x*exp(ln(x-2)/3) else if (x >= 8) and (x <= 13) then y := sqr(sin(x)/cos(x))*cos(1/sqr(x)) else y := (1+sin(x)/cos(x))*exp(3*ln(sin(x))); writeln('Result y = ',y:5:4); end else writeln('Error: x must be a value between ',a,' and ',b,'!'); readkey; end. | 3. Код: program third; uses crt; const xn = 0.2; xk = 1.3; h = 0.1; var x, y, num, denum : real; a1, a2 : real; begin clrscr; x := xn; while x <= xk do begin a1 := 2*sin(x) - exp(x); if a1 < 0 then num:= -exp(ln(abs(a1))/3) else num:= exp(ln(a1)/3); denum := exp(3*ln(sin(x))) - 2*sqr(cos(x)); y := num/denum; writeln('x = ',x:5:2,' y = ',y:5:4); read; x := x + h end; readkey; end. | |