HDU 2072 STL
来源:互联网 发布:win pe 知乎 编辑:程序博客网 时间:2024/06/13 17:04
#include <iostream>#include <set>#include <string>#include <sstream>using namespace std;int main(){ string str,word; while(getline(cin,str) && str != "#") { istringstream stream(str); set<string> map; while(stream >>word) { map.insert(word); } cout <<map.size() <<endl; } return 0;}
istringstream的构造函数原形如下:
istringstream::istringstream(string str);
它的作用是从string对象str中读取字符。
在构造map容器后,用insert函数插入数据,用size查map中插入了多少数据。
0 0
- HDU 2072 STL
- HDU 2072 单词数【STL】
- HDU 2072 (STL set)
- HDU 2072 单词数 (STL map)
- HDU 2072 单词数 (STL:set)
- HDU 1269 STL 自娱自乐
- 【水STL】hdu 4039
- hdu++1800++STL
- HDU 4585 Shaolin (STL)
- hdu 1027 STL
- HDU 4022 STL
- STL容器-----HDU 水果
- hdu 1027 STL next_permutation
- hdu 4302 STL multiset
- HDU 3172 (STL map)
- HDU 2094 STL
- hdu 4989 Summary(STL)
- HDU 1702 STL
- 其他用户访问部署在本地电脑上tomcat中的web项目
- C#中的访问修饰符
- shell常用操作命令系列:网络操作
- Oracle中to_number()函数的用法
- @SuppressWarings注解
- HDU 2072 STL
- LeetCode-485. Max Consecutive Ones
- 快速排序
- 【蓝桥杯】分解质因数
- 一直以来都没直视的轮播-_-
- [生存志] 第131节 纷纷汉家天子事
- React Native 中 component 生命周期
- 文本处理工具
- s:select属性说明和用法介绍