Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Power for integers
function power(x,y:integer):real; var counter:integer; var result:real; begin if y>0 then begin result:=1; for counter:=1 to y do begin if (x>0) or (x<0) then begin result:=result*x; end else begin result:=0; end; end; power:=result; write(power); end else if y=0 then begin result:=1; power:=result; write(power); end else begin if x=0 then begin write('ERROR'); end else begin result:=1; for counter:=1 to abs(y) do begin result:=result*(1/x); end; power:=result; write(power); end end end; var x,y:integer; begin readln(x); read(y); power(x,y); end.
run
|
edit
|
history
|
help
0
Hello, 123
Поиск совершенного числа
Игра НИМ
Busquedad Pascal
Régua do Tanque Cilindrico Horizontal
1januar2018
Луноход-3
6
Calculatrice(TROP compliqué)
sandogh 1