public static void main(String[] args) {
		int total = 11;//数据总量	
		int row = 3;//一页显示条数
		int totalPages;//总页数
	totalPages = total / row;
	if (total % row != 0){
		totalPages ++;
	}
	System.out.println(totalPages);//此方法容易理解
	System.out.println((total-1)/row+1);//此方法使用较多
	System.out.println((total+row-1)/row);
 }

java计算总页数

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-21
  • 2022-03-01
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-30
  • 2022-12-23
  • 2021-05-27
相关资源
相似解决方案