UVa ---10391 - Compound Words
来源:互联网 发布:vb转vc 编辑:程序博客网 时间:2024/05/01 21:50
这道题主要用来练习stl 的 map 以及string的substr
贴上代码
#include <iostream>#include <string>#include <map>using namespace std;map<string, int>aa;string s[150005];int main(){ int cnt=0; string a ,b; while (cin>>s[cnt])aa[s[cnt++]]=1; for (int i=0; i<cnt; i++) { for (int j=0; j<s[i].size(); j++) { a = s[i].substr(0,j+1); if(!aa[a])continue; b = s[i].substr(j+1); if(!aa[b])continue; cout<<s[i]<<endl; break; } } return 0;}
0 0
- uva 10391 compound words
- UVa 10391 - Compound Words
- uva 10391 - Compound Words
- uva 10391 - Compound Words
- UVa 10391 - Compound Words
- UVa 10391 - Compound Words
- uva 10391 - Compound Words
- UVA 10391 Compound Words
- UVA 10391 - Compound Words
- Uva-10391-Compound Words
- UVa 10391 - Compound Words
- uva--10391 - Compound Words
- UVA 10391 Compound Words
- UVa:10391 Compound Words
- uva 10391 Compound Words
- UVa 10391 - Compound Words
- UVA 10391 Compound Words
- UVA 10391 - Compound Words
- Java 中 interface 的 代理模式
- 使用 Git 管理源代码
- iOS简单的多表查询以及SQLite注意点
- 【GStreamer开发】GStreamer基础教程11——调试工具
- OpenDaylight搭建集群(译)
- UVa ---10391 - Compound Words
- Spring 整合 ActiveMQ
- 0217
- springMVC基础
- arm-linux安排开发环境(一)安装ssh server
- 小米手机连接USB安装应用出错
- Reporting services匿名访问配置
- LinuxWorld大派奖
- 第一天,我会坚持的