atoi 函数和 strtok 函数
char s[]="qwery tu ii op";
char *p=strtok(s," ");
while(p!=NULL){
cout<<p<<endl;
p=strtok(NULL," ");
}
以" "截取字符串,第一次赋值的时候必须写上原字符串,后面则不需要赋值
如果要把字符串转化成整型,则需要atoi函数
char s[]="123 456 789";
char *p=strtok(s," ");
while(p!=NULL){
int t=atoi(p);
cout<<t<<endl;
p=strtok(NULL," ");
}