Advertisement
Guest User

Untitled

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