Num1.留言板分页问题
假设共有x页,每页有n行,最后一页不足一页按一页计。
所需设置的页数为:(x+(n-1))/n
Num2.跑马灯问题
让x的值在0至9之间循环变化。
int x=0;
while(true) {
x=(x+1)%10;
}