Search found 1 match

by Phoenix dark
Sun Aug 27, 2006 2:35 am
Forum: Volume 5 (500-599)
Topic: 591 - Box of Bricks
Replies: 80
Views: 25011

591

Can anyone please tell me what's wrong with this code:

#include <stdio.h>


main()
{
int n,h[200],sum=0,sum2=0,h1[100000];
int k=0,i,j;

while(scanf("%d",&n) && n!=0)
{
for(i=0;i<n;i++)
{
scanf("%d",&h );
sum+=h ;
}

sum=sum/n;

for(i=0;i<n;i++)
{
if(h -sum>0)
{
sum2+=(h -sum ...

Go to advanced search