Advertisement
StoneHaos

269

Oct 29th, 2019
301
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.40 KB | None | 0 0
  1. //269
  2. #include <iostream>
  3. #include <cstdio>
  4. using namespace std;
  5.  
  6. int main(void) {
  7.     ios_base::sync_with_stdio(false);
  8.     cin.tie(NULL);
  9.     freopen("input.txt", "r", stdin);
  10.     freopen("output.txt", "w", stdout);
  11.     int n, a, b, cnt = 0;
  12.     cin >> n;
  13.     for (int i = 0; i < n; ++ i) {
  14.         cin >> a >> b;
  15.         if (a % 2 == 0 && b % 2 == 0 || a % 2 != 0 && b % 2 != 0)
  16.             ++ cnt;
  17.     }
  18.     cout << cnt;
  19.     return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement