gts_47's blog

By gts_47, history, 7 years ago, In English

K is given integer . In code when I take K as an integer it gives wrong answer but in same code when I change data type of K to float it gives correct answer . There is also confusion in problem statement ,efficiency is stated non-integer in the first paragraph and integer in the input paragraph.

  • Vote: I like it
  • -18
  • Vote: I do not like it

»
7 years ago, # |
  Vote: I like it 0 Vote: I do not like it

It doesn't matter if you take k as float or int, if you typecast the expressions involved in comparison to float..