Advertisement
Josif_tepe

Untitled

Dec 15th, 2022
876
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.  
  4.  
  5. int main() {
  6.     int n;
  7.     scanf("%d", &n);
  8.    
  9.     int niza[n];
  10.    
  11.     for(int i = 0; i < n; i++) {
  12.         scanf("%d", &niza[i]);
  13.     }
  14.     int parni = 0;
  15.     int neparni = 0;
  16.     for(int i = 0; i < n; i++) {
  17.         if(niza[i] % 2 == 0) {
  18.             parni++;
  19.         }
  20.         else {
  21.             neparni++;
  22.         }
  23.     }
  24.     printf("Parni  %d\n", parni);
  25.     printf("Neparni %d\n", neparni);
  26.    
  27. }
  28.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement