Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program Lab3V1;
- {$APPTYPE CONSOLE}
- {$R *.res}
- uses
- System.SysUtils;
- var a, b, c, d, e, y, max, error : real;
- x1, x2: integer;
- function value (a, b, c, d, e: real; x1, x2: integer):real;
- var i : integer;
- begin
- for i := x1 to x2 do
- begin
- y := (a*i*i + b*i + c)/(d*i + e);
- if max < y then max := y;
- end;
- value := max ;
- end;
- begin
- repeat
- try
- writeln ('Введите a');
- readln (a);
- writeln ('Введите b');
- readln (b);
- writeln ('Введите c');
- readln (c);
- writeln ('Введите d');
- readln (d);
- writeln ('Введите e');
- readln (e);
- writeln ('Введите x1');
- readln (x1);
- writeln ('Введите x2');
- readln (x2);
- error := 0;
- except
- writeln ('Можно вводить только числа, повторите попытку');
- error := 1;
- end;
- until error = 0;
- writeln (value (a, b, c, d, e, x1, x2):3:2);
- readln;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement