📄 4863964_ac_16ms_236k.cpp
字号:
#include<iostream>
#include<string>
using namespace std;
int main()
{
bool find[28][28];
bool tnot;
string input;
while(cin>>input)
{
if(input=="*") break;
int i,j;
tnot=false;
for(i=1;i<input.length();i++)
{
memset(find,false,sizeof(find));
for(j=0;j+i<input.length();j++)
{
char t1=input[j];
char t2=input[j+i];
if(!find[t1-'A'][t2-'A']) find[t1-'A'][t2-'A']=true;
else {tnot=true;break;}
}
if(tnot) break;
else continue;
}
if(tnot) cout<<input<<" is NOT surprising.\n";
else cout<<input<<" is surprising.\n";
}
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -