Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program lol;
- uses crt;
- var
- x, y, k, j,b: integer;
- function pow(x,y: integer): integer;
- var
- s,k:integer;
- begin
- s := x;
- for k := 1 to (y-1) do
- s := s * x;
- if y = 0 then
- result:=1
- else
- result := s;
- end;
- begin
- clrscr;
- readln(x, y);
- b := 0;
- j := 0;
- k := 0;
- while x > 0 do
- begin;
- b := b + (x mod 10) * pow(y, j);
- x := x div 10;
- j := j + 1;
- end;
- writeln(b);
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement