#include<cstdio> #include<cstring> #include<cstdlib> #include<algorithm> #include<queue> #include<vector> #include<stack> using namespace std; const int MAX = 1000; char s[MAX]; int main(){ int n; while (scanf("%d%s",&n,s) != EOF){ int ok = 0,len = n; for (int l = 1; l<len; l++){ for (int i = 0; i<len; i++){ int j, cnt = 0; for (j = i; j<len; j+=l){ if (s[j] == '*'){ cnt++; } else{ break; } } if (cnt >= 5){ ok = 1; break; } } if (ok) break; } if (ok) printf("yes\n"); else printf("no\n"); } return 0; }
526A - King of Thieves
最新推荐文章于 2025-08-10 09:06:06 发布
本文介绍了一个用于检测字符串中特定模式的算法实现,该算法能够检查输入的字符串是否包含至少五个连续的相同字符,并据此判断输出 yes 或 no。通过使用 C 语言标准库中的功能和循环结构,该程序有效地完成了模式匹配任务。
7252

被折叠的 条评论
为什么被折叠?



