ITeye博客

页数计算公式

kalllx · 2012-09-19 11:17 · 编程语言 · Markdown

public static void

main(String[] args)

{

 

 

int

count = 119;

 

 

int

size = 3;

System.

 

out

.println((count-1)/size+1);

 

count/size +1 这种情况下如果是整数 会多算出一页,所以 count-1了,这样可以避免正好整数情况下算错

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。