Advertisement
Guest User

Untitled

a guest
Oct 17th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. #include<fstream>
  3. #include<algorithm>
  4.  
  5. using namespace std;
  6. ifstream we;
  7. ofstream wy;
  8. string a;
  9. int wynik1, wynik2;
  10.  
  11. int main()
  12. {
  13. we.open("dane.txt");
  14. wy.open("wyniki 6.1.txt");
  15.  
  16. while ( getline(we, a))
  17. {
  18. if ( a[9] % 2 == 0 )
  19. wynik1++;
  20. else wynik2++;
  21. }
  22. cout << wynik1 << " " << wynik2;
  23.  
  24. we.close();
  25. wy.close();
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement