天天看點

BZOJ 2295: 【POJ Challenge】我愛你啊

題目連結:​​傳送門​​

#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <complex>
#include <algorithm>
#include <climits>
#include <queue>
#include <map>
#include <set>
#include <vector>
#include <iomanip>
#define
#define

using namespace std;
typedef long long ll;
char s[A], a[] = "luvletter";
 
int main(int argc, char const *argv[]) {
  int T; cin >> T; getchar();
  while (T--) {
    int ans = 0; gets(s);
    for (int i = 0, j = 0; s[i]; ++i) {
      if (s[i] == a[j]) ++j;
      if (j > 8) j = 0, ++ans;
    }
    cout << ans << endl;
  }
  return 0;
}