Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int det(int n)
- {int p=1,i=1,a,b;
- do
- {
- i++;p=p*i;
- }
- while (p<n);
- if (p==n) return n;
- else {b=p-n; p=p/i; a=n-p; if (a<=b) return p; else return p*i; }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement