Can anybody please explain why I got wrong answer? (SIMPSTAT)

The simple program is giving wrong answer when I used “array of float” and as I changed it to “array of int” the It Gave correct answer, why so ?

PS :- This program requires to find the average of elements of some remaining element
after doing manipulation as given in question.

  1. Question Link : SIMPSTAT Problem - CodeChef

  2. Correct Answer : CodeChef: Practical coding for everyone

  3. Wrong Answer : CodeChef: Practical coding for everyone

1 Like