main.c 351 B

123456789101112131415161718
  1. #include <stdlib.h>
  2. #include "counter.h"
  3. void read_ulong(unsigned long *r) {
  4. *r = 0;
  5. for (unsigned long i = 0; i < sizeof(unsigned long); i++)
  6. *r |= ((unsigned long)fgetc(stdin)) << (i*8);
  7. }
  8. int main(int argc, char **argv) {
  9. unsigned long number;
  10. read_ulong(&number);
  11. counter_create(number, stdout);
  12. return 0;
  13. }