Weird behavior of Visual Studio

Правка en2, от skpro19, 2018-01-02 21:11:59

I observed a weird thing today in the Visual Studio IDE while solving the second question of Hourrank 25. This the the code.

On my local machine, the value of pre[0][0], automatically becomes 1 randomly anywhere inside the while loop. However, the weird thing is, if I initialise the value of fact[0] to 0, then everything becomes normal again. This is weird because the computation of fact has nothing to do with the value of pre[0][0].

I feel silly asking this, but what am I missing? The code which is giving wrong answer on the local machine , gives the correct answer on Ideone, and also fetches full marks after submission.

Can someone please help.

Thanks. Peace.

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский skpro19 2018-01-02 21:11:59 7 Tiny change: 's the the ![ ](https://' -> 's the the [code](https://'
en1 Английский skpro19 2018-01-02 21:11:13 744 Initial revision (published)