All pastes #996113 Raw Edit

Anonymous

public text v1 · immutable
#996113 ·published 2008-04-24 18:53 UTC
rendered paste body
#include <stdio.h>
#include <time.h>

#define TOP 10
#define DOWN 1
#define MAX 30

int main()
{
   int N[MAX];
   int C[TOP] = {0};
   int x, i, max = 0;
   
   printf("Koliko brojeva?");
   scanf("%d", &x);
   srand((time) NULL);
   for (i = 0; i < x; i++) {
      N[i] = rand() % TOP + DOWN;
      C[N[i]-1]++;
   }
   for (i = 0; i < TOP; i++) {
      if (C[max] < C[i])
         max = i;
   }
   max++;
   printf("Najvise se ponavlja broj: %d\n", max);
   getche();
   return 0;
}