题解 | 统计单词

#include <bits/stdc++.h>
using namespace std;

int main(){
    string s;
    queue<int>q;
    while(cin>>s){
        if(s[s.size()-1]=='.'){
            q.push(s.size()-1);
            break;
        }
        q.push(s.size());
    }
    while(!q.empty()){
        cout<<q.front()<<" ";
        q.pop();
    }cout<<endl;
}

用啥都行,练习一下queue

全部评论

相关推荐

10-31 22:23
门头沟学院 Java
天然不是卷王:太好了 佬的金九银十结束,等offer吐出来,我的金11银12就要开始了
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务