SHARE
TWEET

Untitled

a guest Jan 21st, 2020 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <cstring>
  3. #include <fstream>
  4. using namespace std;
  5. ifstream f("date.in");
  6. int v[100];
  7. void produs(int x, int v[] , int &n)
  8. {
  9.     int i , t =0 , k;
  10.     for(i=1;i<=n;i++)
  11.     {
  12.         k=x*v[i]+t;
  13.         v[i]=k%10;
  14.         t=k/10;
  15.     }
  16.     while(t>0)
  17.     {
  18.         n++;
  19.         v[n]=t;
  20.         t/=10;
  21.     }
  22. }
  23. int main()
  24. {
  25.     int x ;
  26.     int i =1;
  27.     int nr=0;
  28.     int m ;
  29.     int n , b ;
  30.     cin>>n;
  31.     v[1]=1;
  32.     m=1;
  33.  
  34.     for(int j=1;j<=n;j++)
  35.         produs(j,v,m);
  36.     for(int i=m;i>=1;i--)
  37.         cout<<v[i];
  38. }
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