EWTD

dz1

Sep 14th, 2017
150
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. program lol;
  2.  
  3. uses crt;
  4. var
  5.   x, y, k, j,b: integer;
  6.  
  7. function pow(x,y: integer): integer;
  8. var
  9. s,k:integer;
  10. begin
  11.   s := x;
  12.   for k := 1 to (y-1) do
  13.     s := s * x;
  14.     if y = 0 then
  15.     result:=1
  16.     else
  17.   result := s;
  18. end;
  19.  
  20. begin
  21.   clrscr;
  22.   readln(x, y);
  23.   b := 0;
  24.   j := 0;
  25.   k := 0;
  26.   while x > 0 do
  27.   begin;
  28.     b := b + (x mod 10) * pow(y, j);
  29.     x := x div 10;
  30.     j := j + 1;
  31.   end;
  32.   writeln(b);
  33. end.
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×