UESTC 1595 寻找算法
来源:互联网 发布:300339润和软件 编辑:程序博客网 时间:2024/05/22 10:26
Description
pfctgeorge很喜欢algorithm这个词,他总在到处找这个词。
现在他拿到一些英文写的文章,他想删掉一些字符,使得最后剩下的字符接起来以后是一个接一个的"algorithm"。
请问pfctgeorge最后能得到最多多少个"algorithm"?
Input
输入的第一行是一个整数T(T<=50),表示有T段文章。
接下来T行,每行是一个长度不大于1000字符串,由小写字母或者空格、逗号、句号组成,表示一段文章。
Output
对于每一段文章,输出一行,只包含一个整数,表示最后能得到"algorithm"最多的个数。
Sample Input
3
i love algorithm, and i have an algorithmic problem. can you help me?
reverse it, and get mhtirogla.
there is a large orange in the microwave oven.
Sample Output
2
0
1
#include <cstdio>#include <cstdlib>#include <cstring>#include <iostream>#include <cmath>#include <algorithm>using namespace std;char f[10]={"algorithm"};char s[1010];int main(){int T,i;scanf("%d",&T);getchar();while (T--){char s[1010];gets(s);int l=strlen(s);int j=0,t=0;for (i=0;i<l;i++){if (f[j]==s[i])j++;if (j>8) {j=0;t++;}}printf("%d\n",t);} return 0;}
- UESTC 1595 寻找算法
- 寻找质因子 UESTC
- 线性代数 高斯消元!UESTC 算法讲堂。
- UESTC
- UESTC
- UESTC
- UESTC
- UESTC
- UESTC
- UESTC
- UESTC
- UESTC
- UESTC
- UESTC
- UESTC
- UESTC
- UESTC
- UESTC
- 将U盘格式成UTFS格式
- ORACLE游标概念讲解
- [转载]从零开始学习OpenGL ES之六 – 纹理及纹理映射
- 软件工程初识
- 第一天开通博客
- UESTC 1595 寻找算法
- performance——省电
- Log() 的作用
- Deep Learning(深度学习)学习笔记整理
- liunx流处理命令
- 网站地图优化和操作
- 寄存器使用
- js日期判断先后
- 推荐10个开发者最常用的代码编辑器