a53

Proth Number

a53
Dec 30th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. int n,k=1,x;
  7. cin>>n;
  8. n--;
  9. while(k<(n/k))
  10. {
  11. if(n%k==0)
  12. {
  13. x=n/k;
  14. if((x && !(x & (x - 1))))
  15. {
  16. cout<<"DA";
  17. return 0;
  18. }
  19. }
  20. k+=2;
  21. }
  22. cout<<"NU";
  23. }
Add Comment
Please, Sign In to add comment