suggi_d_luffy's blog

By suggi_d_luffy, history, 9 years ago, In English

Giving WA.Where is the error? Problem link : 147 — Dollars Solution link : SOLUTION

Tags wa, help
  • Vote: I like it
  • -3
  • Vote: I do not like it

»
9 years ago, # |
  Vote: I like it +1 Vote: I do not like it

The error comes from converting double to int. Sometimes compilers don't work as expected and, for example, instead of 11 you might get 10.999999999999999999, which rounds down to 10.

Here's your code with string parsing and integers (AC): Corrected code