Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdint.h>
- #include <inttypes.h>
- enum { M_SIZE = 53 };
- int match(uint64_t num) {
- while (num != 0 && (num & 1u) == 0) {
- num >>= 1;
- }
- return (num >> (M_SIZE + 1)) == 0;
- }
- int main()
- {
- uint64_t numb = 0;
- while (scanf("%" PRIu64, &numb) == 1) {
- printf("%d\n", match(numb));
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement