Source code for submission s564

bugs.cpp

  1. #include <iostream>
  2. #include <string>
  3. #include <cstdio>
  4. #include <iostream>
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9. string line, bug;
  10. int T;
  11. unsigned pos;
  12.  
  13. while (scanf("%d ", &T) == 1)
  14. {
  15. getline(cin, bug);
  16. for (;T;T--)
  17. {
  18. getline(cin, line);
  19. while ((pos = line.find(bug)) != string::npos)
  20. line.erase(pos, bug.length());
  21. printf("%s\n", line.c_str());
  22. }
  23. }
  24.  
  25. return 0;
  26. }
  27.