Replace ALL 0 with 5

I tried this here is my code please have a look don’t know why failing ?
https://hack.codingblocks.com/app/contests/3668/161/problem