博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
统计不同单词个数
阅读量:2352 次
发布时间:2019-05-10

本文共 452 字,大约阅读时间需要 1 分钟。

#include
#include
#include
#include
#include
using namespace std;int main(){    string s1, s;    set
set1;    while(getline(cin, s))    {        if(s[0] == '#')            break;        for(int i = 0; i <= s.size() - 1; i++)        {            if(s[i] != ' ')                s1 = s1 + s[i];            if((s[i] == ' ' && !s1.empty()) || (i == s.size() - 1 && !s1.empty()))            {                set1.insert(s1);                s1.clear();            }        }        cout << set1.size() << endl;        set1.clear();    }    return 0;}

 

转载地址:http://knwtb.baihongyu.com/

你可能感兴趣的文章
DSP开发板
查看>>
stm32标准外设库和芯片资料下载地址
查看>>
ARM Keil MDK开发STM32工程模板
查看>>
NoSQL分类及常用软件
查看>>
ubuntu 16.04安装nVidia显卡驱动和cuda/cudnn踩坑过程
查看>>
基于STM32CubeMX创建STM32L496ZGTx的工程
查看>>
如何通过OpenFace实现人脸识别框架
查看>>
Angle和XBGoost以及Spark的性能对比
查看>>
IOS CoreImage实现人脸识别
查看>>
Tensorflow的高级封装
查看>>
Storm 1.1.0 集群安装
查看>>
图像压缩算法
查看>>
一张图看懂小程序全生态
查看>>
electron开发
查看>>
Electron如何调用NodeJS扩展模块
查看>>
NodeJS通过ffi调用DLL
查看>>
Electron通过ffi调用DLL
查看>>
Node.js & Electron的扩展模块
查看>>
Mysql semi-sync VS group replication, 谁快?
查看>>
Android Looper Message MessageQueue Handler
查看>>