#include <stdio.h>
int myatoi(char *str){
int result=0;
int i=0;
while( str[i] ){
result = result*10 + str[i] - '0';
i++;
}
return result;
}
void main(){
char num[10]="1234";
printf("%d",myatoi(num));
}