Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.29 KB | None | 0 0
  1. #include <string>
  2. #include <iostream>
  3. #include <fstream>
  4.  
  5. using namespace std;
  6.  
  7. string srednik(string s) {
  8.     ifstream plik;
  9.     plik.open(s);
  10.     string lines;
  11.  
  12.     while (!plik.eof()) {
  13.         getline(plik, lines);
  14.         if (lines[lines.size() - 1] == ';') {
  15.             return lines;
  16.         }
  17.     }
  18.  
  19.     return "brak";
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement