Advertisement
Josif_tepe

Untitled

Aug 21st, 2023
615
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.47 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. int main(int argc, const char * argv[]) {
  4.     int n;
  5.     scanf("%d", &n);
  6.    
  7.     int niza[n];
  8.     for(int i = 0; i < n; i++) {
  9.         scanf("%d", &niza[i]);
  10.     }
  11.     int parni = 0;
  12.     int neparni = 0;
  13.    
  14.     for(int i = 0; i < n; i++) {
  15.         if(niza[i] % 2 == 0) {
  16.             parni++;
  17.         }
  18.         else {
  19.             neparni++;
  20.         }
  21.     }
  22.     printf("%d %d\n", parni, neparni);
  23.     return 0;
  24. }
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement