>>828
a = 1 + a%100;

ではダメか?