public class Demo {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入总记录数");
        int total = sc.nextInt();
        System.out.println("请输入每页显示多少条数据");
        int size = sc.nextInt();
        int page = total % size == 0 ? total / size : total / size + 1 ;
        System.out.println("一共:"+page+"页");
    }
}

简单的分页小demo

 

相关文章:

  • 2022-12-23
  • 2021-09-12
  • 2022-12-23
  • 2022-12-23
  • 2021-07-23
  • 2021-06-06
  • 2021-09-02
  • 2021-10-12
猜你喜欢
  • 2021-07-25
  • 2021-10-07
  • 2022-12-23
  • 2022-01-18
  • 2021-09-01
  • 2021-08-29
相关资源
相似解决方案