Advertisement
Guest User

Untitled

a guest
Nov 13th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. { string a;
  8. int wynik=0;
  9. cout << "licze ile liter a jest w tekscie" << endl;
  10. ifstream odczyt ("dane.txt");
  11. if (odczyt.is_open())
  12. { char znak;
  13. while (odczyt>>znak)
  14. {
  15. if(znak=='a')
  16. {
  17. wynik=wynik+1;
  18. }
  19. znak=znak+1;
  20. }
  21. cout<<wynik;
  22. cin.get();
  23. odczyt.close();
  24. }
  25. return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement