Advertisement
mhdew

nadim_2

Aug 13th, 2021
631
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.31 KB | None | 0 0
  1. #include<stdio.h>
  2.  
  3. int main(){
  4.  
  5.     int ct[111];
  6.     int ar[111];
  7.     int n, x, i;
  8.  
  9.     for(i=0;i<111;i++){
  10.         ct[i]=0;
  11.     }
  12.  
  13.     scanf("%d", &n);
  14.     for(i=0;i<n;i++){
  15.         scanf("%d", &x);
  16.         ct[x]++;
  17.     }
  18.  
  19.     for(i=0;i<=100;i++){
  20.         if(ct[i]!=0){
  21.             printf("%d is repeated %d times\n",i,ct[i]);
  22.         }
  23.     }
  24.  
  25.     return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement