#include <stdio.h>
int strtoint(char * s) {
int index = 0, flag = 0;
while ( * (s + index) != '#include <stdio.h>
int strtoint(char * s) {
int index = 0, flag = 0;
while ( * (s + index) != '\0') {
if (( * (s + index) >= '0') &&
*
(s + index) <= '9') {
flag = 1;
index++;
} else {
flag = 0;
break;
}
}
if (flag == 1)
return atoi(s);
else
return 0;
}
main() {
printf("%d", strtoint("0123"));
printf("\n%d", strtoint("0123ii"));
}
') {
if (( * (s + index) >= '0') &&
*
(s + index) <= '9') {
flag = 1;
index++;
} else {
flag = 0;
break;
}
}
if (flag == 1)
return atoi(s);
else
return 0;
}
main() {
printf("%d", strtoint("0123"));
printf("\n%d", strtoint("0123ii"));
}