POJ 3096
来源:互联网 发布:如何windows截屏 编辑:程序博客网 时间:2024/06/02 03:52
map
代码如下
bool类型是默认为false
#include<cstdio>#include<iostream>#include<cstring>#include<algorithm>#include<map> using namespace std;int main(){string s;while(cin>>s){if(s[0]=='*'&&s.size()==1) break;if(s.size()==1||s.size()==2){cout<<s<<" is surprising."<<endl; continue;}int flag=0;for(int i=1;i<=s.size()-2;i++){map<string,bool> p;for(int j=0;j<s.size()-i;j++){string temp;temp+=s[j]; temp+=s[j+i];if(!p[temp]){p[temp]=true;}else {flag=1;break;}}if(flag==1) {break;}}if(flag==0) cout<<s<<" is surprising."<<endl;else cout<<s<<" is NOT surprising."<<endl;} }
阅读全文
0 0
- poj-3096
- POJ 3096
- poj 3096
- POJ-3096
- POJ 3096
- POJ-3096
- POJ 3096
- POJ 3096
- poj 3096 Surprising Strings
- poj 3096 Surprising Strings
- poj 3096 Surprising Strings
- poj 3096 Surprising Strings
- POJ 3096 Surprising Strings
- POJ 3096 Surprising Strings
- POJ 3096 Surprising Strings
- POJ 3096 SET 练习
- poj 3096 Surprising Strings
- poj 3096 Surprising Strings
- mac homebrew 常用命令
- http://www.discuz.net/forum.php?mod=viewthread&tid=611716&page=1&authorid=13759
- Vertex Cover
- Android 7.0 java.lang.SecurityException: MODE_WORLD_READABLE no longer supported闪退
- webstorm 2016.3激活
- POJ 3096
- Hbase基础
- JS判断微信扫码的方法
- CentOS7.3中Tomcat8启动出错问题
- EasyStream系列3之rtsp转rtsp
- C 和 C++的对比
- speex中的AEC框架介绍(in C)
- android开发 NDK 编译和使用静态库、动态库
- QT将信息保存到某个路径下(2)