Advertisement
KingaGolas

Zad 3.6

May 30th, 2020
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. ifstream wiersz("Wiersz.txt");
  9. if (!wiersz.is_open())
  10. {
  11. cout<<"Brak dostepu do pliku";
  12. }
  13.  
  14. int i=1;
  15. char x;
  16. while(wiersz.get(x))
  17. {
  18. if (i%3==0)
  19. {
  20. cout<<x<<" ";
  21. i++;
  22. }
  23. else
  24. {
  25. i++;
  26. }
  27.  
  28. }
  29. return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement