关于cin>>输入多串字符串的疑问

设计一个检查字串内重复单词的程序

#include<iostream>
using namespace std;
int main() {
    string previous = " ";
    string current;
    //cin >> current;//输入the cat cat jump
    //cout << current;//cout结果是只有the,说明current只储存了the但以下代码却能识别cat
    while (cin>>current)
    {

        if (previous == current)
            cout << "repeated word:" << current << "\n";
            previous = current;
    }
}

运行输入 the cat cat jump,能正常识别重复单词是cat

我的疑问是:
运行到 while(cin>>current)时,
由于输入字串存在空格字符,
不应该是current只读取到the,后面的cat cat jump均无法被存储在current内吗?
为什么while函数还是能进行cat 与cat对比

这个是输入缓存的功能,你输入的东西保存在stdin的缓存里,cin从缓存中读取同时从缓存中删掉读入的内容,遇到空白字符结束读取。下一次继续从缓存读取。