Toggle navigation
Home
Latest pastes
FAQ
Random
BitBin is shutting down!
Register
Login
brojanje
SUBMITTED BY:
Guest
DATE:
Nov. 23, 2013, 4:44 p.m.
FORMAT:
Text only
SIZE:
1.0 kB
Raw
Download
Tweet
HITS:
692
Go to comments
Report
http://cur.lv/4x9e0 (Earn Bitcoins)
#include<stdio.h>
#define N 10
#define MAX 5
#define DG 1
#define GG 5
main()
{
int broj,i,br=0,max=0,maxKoji,minKoji,min=0;
int polje[MAX]={0};
do{
scanf("%d",&broj);
if(broj<1 || broj>5)
{
printf("Krivi unos!!!\n");
}
if(broj>=DG && broj<=GG)
{
polje[broj-DG]++;
br++;
}
}while(br<N);
for (i = DG; i <= GG; i++)
{
if(polje[i-DG]>0)
{
printf("\nBroj %d se pojavio %d puta",i,polje[i-DG]);
}
if (polje[i-DG] > max)
{
max=polje[i-DG];
maxKoji= i;
}
}
for(i=DG; i<=GG; i++)
{
printf("\n\nNajvise se pojavio broj: %d i to %d puta\n",maxKoji,max);
}
return 0;
}
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus