Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main ()
- {
- unsigned n,k=1,x,p,ok=0;
- cout<<"n=";cin>>n;
- while (k<n&&!ok)
- {
- p=1;
- for (x=1;x<=k;x++)
- p*=x;
- if (p==n)
- ok=1;
- else
- k++;
- }
- if (ok)
- cout<<"DA"<<endl<<k;
- else
- cout<<"NU";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement