3 uelem_type
= ^element_type
;
10 function pow( a
,b
:real):real;
11 { функция возведения в степень (a^b) }
15 if a
< 0 then pow
:= (-1)*exp(b
*ln(t
))
16 else pow
:= exp(b
*ln(t
));
20 function parse_polinom(str_line
:string): uelem_type
;
22 polinom
, polinom_first
: uelem_type
;
26 polinom
:= polinom_first
;
28 for i
:=1 to ord( str_line
[0] ) do
30 if str_line
[i
] <> ' ' then
37 val( str_line
[i
], a
, code
);
42 val( str_line
[i
], n
, code
);
52 parse_polinom
:= polinom_first
;
55 function calc_polinom( x
: longint; polinom
: uelem_type
):longint;
66 res
:= res
+( a
* round(pow(x
,n
) ));
68 writeln( a
, ' ', n
, ' ',res
);
75 function main
: integer;
78 OUT_PATH
= 'lab4.out';
84 assign( in_file
, IN_PATH
);
86 readln( in_file
, str_line
);
89 assign(out_file
, OUT_PATH
);
91 writeln(out_file
, str_line
);
92 writeln(out_file
,'----');
93 writeln( out_file
, calc_polinom( 69, parse_polinom( str_line
) ) );