题意:一朵花有三种颜色,ABC,现在花凋谢了,也就是这些颜色会消失,让你判断有没有可能有一朵花三种颜色都在。
题解:模拟 再输入的一串字符串里面判断里面有ABC的全排列。
#include<bits/stdc++.h>
using namespace std;
int main()
{
string s;
cin>>s;
if(s.find("ABC")!=s.npos||s.find("ACB")!=s.npos||s.find("BAC")!=s.npos||s.find("BCA")!=s.npos||s.find("CAB")!=s.npos||s.find("CBA")!=s.npos)
puts("Yes");
else puts("No");
return 0;
}
s=input()
if "ABC" in s or "ACB" in s or "BAC" in s or "BCA" in s or "CAB" in s or "CBA" in s:
print("YES")
else:
print("NO")