• Source
    1. #include <iostream>
    2. #include <fstream>
    3. #include <cstdlib>
    4. #include <string>
    5.  
    6. using namespace std;
    7.  
    8. int main()
    9. {
    10. fstream plik;
    11. string slowo1, slowo2, slowo3;
    12.  
    13. plik.open( "dane.txt", ios::in | ios::out );
    14. while (!(plik.eof()))
    15. {
    16. plik >> slowo1 >> slowo2 >> slowo3;
    17. cout << slowo1 << endl;
    18. cout << slowo2 << endl;
    19. cout << slowo3 << endl;
    20. }
    21. plik.close();
    22.  
    23. return( 0 );
    24. }