int strStr(string haystack, string needle) {
int hLen = haystack.length();
int nLen = needle.length();
int nIndex = 0;
for(int i=0;i<=hLen-nLen;i++){
int j;
for(j=0;j<nLen;j++){
if(haystack[i+j]!=needle[j]){
break;
}
}
if(j==nLen){
return i;
}
}
return -1;
}