Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- unsigned char cur;
- int counter = 0;
- printf("0000000000000000");
- while (true)
- {
- cur = getc(stdin);
- if (feof(stdin))
- {
- break;
- }
- if (counter % 8 == 0)
- putc(' ', stdout);
- if (counter % 4 == 0)
- putc(' ', stdout);
- if (counter % 2 == 0)
- putc(' ', stdout);
- putc(' ', stdout);
- printf("%x%x", cur / 16, cur % 16);
- counter++;
- if (counter % 16 == 0)
- {
- printf("\n%016x", counter);
- }
- }
- if (counter % 16 != 0)
- {
- printf("\n%016x", counter);
- }
- putc('\n', stdout);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment