fork download
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. int has_boris2005(string s) {
  6. int l = s.length() - 9;
  7.  
  8. if (l < 0) return 0;
  9.  
  10. for (int i = 0; i <= l; i++) {
  11. if (s.substr(i, 9) == "boris2005") {
  12. return 1;
  13. }
  14. }
  15.  
  16. return 0;
  17. }
  18.  
  19. int main() {
  20. cin.tie(0); cout.tie(0); ios::sync_with_stdio(false);
  21.  
  22. int n;
  23. cin >> n;
  24.  
  25. int res = 0;
  26.  
  27. for (int i = 0; i < n; i++) {
  28. string t;
  29. cin >> t;
  30.  
  31. res += has_boris2005(t);
  32. }
  33.  
  34. cout << res;
  35.  
  36.  
  37. return 0;
  38. }
  39.  
  40.  
Success #stdin #stdout 0s 5348KB
stdin
2
boris2005_nagibator
20boris05
stdout
1