Different o/p by c++ 4.3.2 and c++ 4.8.1 in solving problem SUMTRIAN(easy)

o/p AC compiler used : 4.3.2
o.p WA compiler used :4.8.1

similar code.
Can somebody explain me the reason?
Thanx in advance.

You’re mixing scanf and cin, weird stuff happens when you do that.

it could be explained by the fact your m array starts uninitialized.

g++ 4.3.2 could add an initialization part for you, and g++ 4.8.1 not.


i took your code, and just added m={0} : got AC.

1 Like

but that doesn’t explain why it got AC in one and WA in other.