Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <assert.h>
- #include <limits.h>
- #include <math.h>
- #include <stdio.h>
- #include <stdlib.h>
- int
- main (int argc, char *argv[])
- {
- assert (argc - 1 == 1);
- long n;
- {
- char *tail;
- n = strtol (argv[1], &tail, 0);
- assert (tail > argv[1]);
- assert (*tail == '\0');
- }
- assert (n >= 1);
- assert (n <= sqrt (LONG_MAX));
- const int width = (int)ceil (2 * log (1 + n) / log (10));
- long i;
RAW Paste Data