题解 | #[NOIP2018]标题统计#

[NOIP2018]标题统计

https://www.nowcoder.com/practice/b14b87bc6a4547a6839e0a5867c98dba

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

int main() {
    
    string str;
    // cin>>str;

    int count=0;

    getline(cin, str);

    // cin>>str;
    for(int i=0; i<str.size(); i++){
        if(str[i] !=' '&& str[i] != '\n')
        {
            count++;
        }
        
    }


    cout<<count<<endl;
return 0;
}
// 64 位输出请用 printf("%lld")

全部评论

相关推荐

没有offer的呆呆:薪资有的时候也能说明一些问题,太少了活不活得下去是一方面,感觉学习也有限
点赞 评论 收藏
分享
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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