fork download
  1. #include <iostream>
  2. #include <cstring>
  3. #include <regex>
  4. using namespace std;
  5.  
  6. const int MAX_LEN = 100;
  7.  
  8. int main() {
  9. int word_count, occurrence_count = 0;
  10. cin >> word_count;
  11. char sir[MAX_LEN + 1];
  12. cin >> sir;
  13. regex r("(sir.+)");
  14. char word[MAX_LEN + 1];
  15. for (int i = 0; i <= word_count; ++i) {
  16. cin.getline(word,MAX_LEN);
  17. if (regex_match(word,r)) {
  18. ++occurrence_count;
  19. }
  20. }
  21. cout << occurrence_count;
  22. return 0;
  23. }
Success #stdin #stdout 0.01s 5408KB
stdin
5
pre
preadmitere
eprezicere
pre
prezentare
practica
stdout
Standard output is empty