func str2int(data string) int {
n := len(data)
if n <= 0 {
return 0
}
ret := 0
flag := 1
for i := 0; i < n; i++ {
if i == 0 && data[0] == '-' {
flag = -1
continue
}
if data[i] > '9' || data[i] < '0' {
break
}
ret = ret*10 + int(data[i]-'0')
}
return ret * flag
}