Non è che hai attivato il Num-Lock usando Fn+qualche altro tasto?
Amaro C++, il gusto pieno dell'undefined behavior.
Regole del Forum