1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
-
-
+
+
-
+
-
+
|
#include <sys/types.h>
#include <stdlib.h>
#include <limits.h>
#include <ctype.h>
#include <stdio.h>
/* We only handle base 10. */
long long int strtoull(const char *nptr, char **endptr, int base) {
unsigned long long int retval = 0;
long long int strtoll(const char *nptr, char **endptr, int base) {
long long int retval = 0;
const char **endptrd = (const char **) endptr;
char *idx = NULL;
const char *idx = NULL;
int allowspace = 1;
idx = nptr;
while (1) {
if (*idx == '\0') {
break;
}
if (!isdigit(*idx)) {
if (*idx == '-') {
retval *= -1;
continue;
}
if ((*idx == ' ' || *idx == '\t') && allowspace) {
continue
continue;
}
break;
}
retval *= 10;
retval += (*idx - '0');
|