Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 21st, 2012  |  syntax: Pascal  |  size: 0.27 KB  |  hits: 19  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. function digit(n:integer):integer;
  2. begin
  3.  digit:=1;
  4.  repeat
  5.   digit:=digit*(n mod 10);
  6.   n:=n div 10;
  7.  until n=0
  8. end;
  9.  
  10. var N:longint;
  11.     k:integer;
  12.  
  13. begin
  14.  readln(N);
  15.  k:=digit(n);
  16.  inc(n);
  17.  repeat
  18.   inc(n);
  19.  until digit(n)=k;
  20.  writeln(n);
  21.  readln;
  22. end.