fork(1) download
  1. #include <iostream>
  2. #include <cstring>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7. int n, contor = 0;
  8. char sir[101];
  9. char curent[101];
  10. cin >> n;
  11. cin >> sir;
  12. for (int i = 0; i < n; i++) {
  13. cin >> curent;
  14. char *p = strstr(curent, sir);
  15. if (p != 0) {
  16. ++contor;
  17. }
  18. }
  19. cout << contor;
  20. }
Success #stdin #stdout 0.01s 5384KB
stdin
5
pre
preadmitere
eprezicere
pre
prezentare
practica
stdout
4