Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- typedef unsigned short int NrMare[10010];
- NrMare y;
- void AtribMic(NrMare x, int n)
- {
- // x=n;
- x[0]=0;
- if(n==0)
- x[(x[0]=1)]=0;
- else
- for(;n;n/=10)
- x[++x[0]]=n%10;
- }
- void ProdusMic(NrMare x, int n)
- //x <- x*n
- {
- int i,t=0;
- for(i=1;i<=x[0];i++,t/=10)
- {
- t+=x[i]*n;
- x[i]=t%10;
- }
- for(;t;t/=10)
- x[++x[0]]=t%10;
- }
- void AfisezMare(NrMare x)
- // afisez x
- {
- int i;
- for(i=x[0];i>=1;i--)
- cout<<x[i];
- }
- int n;
- int main()
- {
- cin>>n;
- AtribMic(y,1);
- for(int i=1;i<=n;i++)
- ProdusMic(y,i); // y=y*i;
- AfisezMare(y);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement