【模拟】bzoj2295 【POJ Challenge】我爱你啊

#include<cstdio>
#include<cstring>
using namespace std;
int n;
char s[100001],table[]="luvletter";
int main()
{
	scanf("%d",&n); getchar();
	for(;n;--n)
	  {
	  	gets(s);
	  	int m=strlen(s),ans=0,p=0;
	  	for(int i=0;i<m;++i)
	  	  if(s[i]==table[p])
			{
			  if(p==8) ++ans;
			  p=(p+1)%9;
			}
		printf("%d
",ans);
	  }
	return 0;
}
原文地址:https://www.cnblogs.com/autsky-jadek/p/4205360.html