1#include <assert.h>2#include <limits.h>3#include <stdio.h>4#include <stdlib.h>56/*7output:8testing9done10end:11*/1213void14test(void)15{16 long long n;17 char buf[64];1819 n = atoll("abc");20 assert(n == 0);2122 n = atoll(" abc");23 assert(n == 0);2425 n = atoll("1234 ");26 assert(n == 1234);2728 n = atoll(" 1234 0");29 assert(n == 1234);3031 n = atoll("+");32 assert(n == 0);3334 n = atoll(" +1");35 assert(n == 1);3637 n = atoll("+ 1");38 assert(n == 0);3940 n = atoll(" -1");41 assert(n == -1);4243 n = atoll("- 1");44 assert(n == 0);4546 sprintf(buf, "%lld", LONG_MAX);47 n = atoll(buf);48 assert(n == LLONG_MAX);4950 sprintf(buf, "%lld", LONG_MIN);51 n = atoll(buf);52 assert(n == LLONG_MIN);53}5455int56main()57{58 puts("testing");59 test();60 puts("done");6162 return 0;63}