Advertisement
Guest User

Untitled

a guest
Dec 16th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1.     std::vector<std::string> strings;
  2.     {
  3.         std::ifstream input_file("tekst.txt");
  4.         std::string s;
  5.         while (std::getline(input_file,s))
  6.             strings.push_back(s);
  7.     }
  8.     std::cout << "Plik zawiera liczbe linii rowna: " << strings.size() << std::endl;
  9.     for (std::vector<std::string>::size_type i{}; i<strings.size(); ++i)
  10.         std::cout << i+1 << ". " << strings[i] << std::endl;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement