怎么让cin把句号当成输入结束,就像空格和回车的作用一样?

怎么让cin把句号当成输入结束,就像空格和回车的作用一样?
如:
输入时是 12.14.12

cin好像没有格式化输入什么的,也不知道有什么方法可以知己定义分隔符,不过你可以用循环cin一个int型的数然后cin.get()把后面那个"."给清除,然后继续cin...

 // ConsoleApplication2.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"

#include <string>
#include <iostream>
#include <list>
using namespace std;


list<string> split(string str, string separator)
{
    list<string> result;
    int cutAt;
    while ((cutAt = str.find_first_of(separator)) != str.npos)
    {
        if (cutAt > 0)
        {
            result.push_back(str.substr(0, cutAt));
        }
        str = str.substr(cutAt + 1);
    }
    if (str.length() > 0)
    {
        result.push_back(str);
    }
    return result;
}

int main()
{
    string s;
    cin >> s;
    list<string> result = split(s, ".");
    for (list<string>::iterator i = result.begin(); i != result.end(); i++)
    {
        cout << (string)*i << endl;
    }
    return 0;
}

12.3.45.678.9
12
3
45
678
9
Press any key to continue . . .

如果是控制台程序,实现起来比较麻烦,且无意义。