str2num(char *p){int num=0,k,len,j;len=strlen(p);for(;*p;p++){k=*p-'0';j=(--len);while(j--){k=k*10;}num=num+k;}return (num);}