Advertisement
Josif_tepe

Untitled

Dec 15th, 2022
816
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.50 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.     int niza[n];
  9.    
  10.     for(int i = 0; i < n; i++) {
  11.         scanf("%d", &niza[i]);
  12.     }
  13.     int brojac[100];
  14.     for(int i = 0; i < 100; i++) {
  15.         brojac[i] = 0;
  16.     }
  17.    
  18.     for(int i = 0; i < n; i++) {
  19.         brojac[niza[i]]++;
  20.     }
  21.    
  22.     for(int i = 0; i < 100; i++) {
  23.         if(brojac[i] > 0) {
  24.             printf("Brojot %d se pojavil %d pati\n", i, brojac[i]);
  25.         }
  26.     }
  27. }
  28.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement