http://www.cnblogs.com/hoys/archive/2011/09/19/2180999.html
http://www.cnblogs.com/longzhao1234/archive/2012/05/31/2528317.html
gets strtok sscanf 组合实现读入一行,分割字符
类似strtok功能还有 strtok_r 和 strsep
strtok使用
(1)第一次传字符串指针(不能指向常量),之后传NULL
(2)使用后字符串被改变
(3)返回值p
#include<stdio.h>
#include<string.h>
#include <sstream>
using namespace std;
char s[1000];
int main()
{
while (gets(s))
{
char *p = strtok(s, " ");
while (p)
{
int x;
sscanf(p,"%d", &x)