fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. #define Task "Test"
  5. #define int long long
  6. #define el '\n'
  7. #define cnt_bit_1 __builtin_popcountll
  8. #define float double
  9. #define IO freopen(Task".inp","r",stdin); freopen(Task".out","w",stdout);
  10. #define pii pair<int,int>
  11. #define fi first
  12. #define se second
  13. #define pb push_back
  14.  
  15. const int N=2e5+5;
  16. const int INF=1e18;
  17. const int MOD=1e9+7;
  18.  
  19. signed main()
  20. {
  21. ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  22. //IO
  23.  
  24. int t; cin >> t;
  25. cin.ignore();
  26. while(t--)
  27. {
  28. string s1 , s2 , s3;
  29. getline(cin , s1);
  30. getline(cin , s2);
  31. getline(cin , s3);
  32. while(s1.find(s2) != -1) s1.replace(s1.find(s2), s2.size(), s3);
  33. cout << s1 << el;
  34. }
  35. return 0;
  36. }
Success #stdin #stdout 0s 5268KB
stdin
Standard input is empty
stdout
Standard output is empty