Advertisement
Guest User

Untitled

a guest
Apr 20th, 2018
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. #include <iostream>
  2. #include <math.h>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. long long n, count, loop;
  9. cin >> loop;
  10. while(loop--)
  11. {
  12. cin >> n;
  13. if(n%2)
  14. {
  15. cout << 0 << endl;
  16. continue;
  17. }
  18. count = 1;
  19. for(int i = 2; i < sqrt(n)+1; i++)
  20. {
  21. if(n%i)
  22. continue;
  23. if(i%2)
  24. {
  25. count++;
  26. continue;
  27. }
  28. else
  29. {
  30. count++;
  31. if(!((n/i)%2) && i != n/i)
  32. count++;
  33. }
  34. }
  35. cout << count << endl;
  36. }
  37. return 0;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement