---
title: "页数计算公式"
author: "kalllx"
date: "2012-09-19T11:17:18Z"
tags: []
categories: ["编程语言"]
slug: "untitled"
draft: false
lastmod: "2012-09-19T11:17:18Z"
id: 1681237
url: "https://kalllx.iteye.com/blog/1681237"
---

**public** **static** **void**

main(String\[] args)

{

 

 

**int**

count = 119;

 

 

**int**

size = 3;

System.

 

*out*

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

 

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