Advertisement
phisiomath

Untitled

Jan 19th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.37 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdint.h>
  3. #include <inttypes.h>
  4.  
  5. enum { M_SIZE = 53 };
  6.  
  7. int match(uint64_t num) {
  8.     while (num != 0 && (num & 1u) == 0) {
  9.         num >>= 1;
  10.     }
  11.     return (num >> (M_SIZE + 1)) == 0;
  12. }
  13.  
  14. int main()
  15. {
  16.     uint64_t numb = 0;
  17.     while (scanf("%" PRIu64, &numb) == 1) {
  18.         printf("%d\n", match(numb));
  19.     }
  20.     return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement