fork download
  1. #include <iostream>
  2. #include <algorithm>
  3. #include <string>
  4. #include <vector>
  5. using namespace std;
  6.  
  7. int main() {
  8. vector<string> text;
  9. string pierwszyTekst = "tutaj cos tam z nowa linia\n";
  10. string drugiTekst = "a tutaj bez nowej linii";
  11. text.push_back(pierwszyTekst);
  12. text.push_back(drugiTekst);
  13.  
  14.  
  15. for (auto str : text)
  16. {
  17. if(str.find("\n") != string::npos)
  18. {
  19. cout << str;
  20. }
  21. }
  22. // your code goes here
  23. return 0;
  24. }
Success #stdin #stdout 0s 3460KB
stdin
Standard input is empty
stdout
tutaj cos tam z nowa linia