I'm trying to answer this question on Spoj ,, It's about claculating the average of numbers witth many test cases..
This is all i could write in such code,, It works with only the 1st test case,,but doesn't with the rest!!
don't know why!!
can I get some help with this code please???
Your code is hard to read..
You declared sum=0 only at the beginning, which means after the first test sum is not reset so it adds up to the previous sums.