thanks a lot, I suppose the problem was on blank or EOF checks ... Maybe I've to study iostream better :) but why 14 bits wasn't too much? if 0<M<9999 and 2^14 = 16384 I think 14 bits are enogh (ok 13 were few :) ... But when I try to submit my source with the following lines: