SHARE
TWEET

Untitled

a guest Apr 25th, 2019 88 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //fpc 3.0.0
  2.  
  3. function factorial(n: Integer): Integer; begin
  4.   if n <> 1
  5.   then factorial := n * factorial(n-1)
  6.   else factorial := 1
  7. end;
  8.  
  9. var
  10.   n1, n2, n3: Integer;
  11.   m1, m2, m3: Integer;
  12.  
  13. begin
  14.  
  15.   readln(n1, m1);
  16.   readln(n2, m2);
  17.   readln(n3, m3);
  18.  
  19.   writeln(factorial(n1) mod m1);
  20.   writeln(factorial(n2) mod m2);
  21.   writeln(factorial(n3) mod m3);
  22.  
  23. end.
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top