HDU 2072 单词数【STL】
来源:互联网 发布:红外光谱分析软件 编辑:程序博客网 时间:2024/06/06 00:06
看字典树的时候看到的,然而队友看了一眼说用 STL 容器做。。。嗯。。给跪了
#include<iostream>#include<cstring>#include<cmath>#include<algorithm>#include<cstdio>#include<set>using namespace std;int main(){ char c[10000]; string word=""; while(gets(c)) { set<string>mapp; if(c[0]=='#') break; else { int l=strlen(c); c[l]=' '; //cout<<l<<endl; for(int i=0;i<=l;i++) { if(c[i]==' ') { //cout<<" "<<word<<endl; if(word!="") mapp.insert(word); word=""; } else word+=c[i]; } } cout<<mapp.size()<<endl; /*if(c!=' ') { word+=c; } else if(c==' ') { cout<<word<<endl; mapp.insert(word); word=""; } else if(c=='#') break;*/ }}
0 0
- HDU 2072 单词数【STL】
- HDU 2072 单词数 (STL map)
- HDU 2072 单词数 (STL:set)
- hdu 2072 单词数(STL set写法)
- HDU 2072 单词数
- hdu 2072 单词数
- hdu 2072 单词数
- HDU 2072 单词数
- HDU 2072 单词数
- Hdu 2072 - 单词数
- Hdu 2072 单词数
- hdu 2072-单词数
- hdu 2072 单词数
- HDU 2072 单词数
- HDU 2072 单词数
- HDU 2072 单词数
- hdu 2072 单词数
- hdu 2072 单词数
- leetcode-Valid Anagram
- Android USB转串口编程
- java serialization/deserialization (序列化对象自描述)
- javaEE和javaSE的区别和联系
- K-均值算法
- HDU 2072 单词数【STL】
- Caused by: org.hibernate.TransactionException: unable to commit against JDBC connection
- 多线程下载断点下载
- JPA中L2 cache和query cache初探
- Android 屏幕方向监听
- ionic工程组织文件
- HTTP/2和WebSocket及HTML5资料整理--WebSocket/HTML5篇
- Caused by: java.sql.SQLException: Couldn't perform the operation commit
- Windows平板真机调试