Skip to content

Instantly share code, notes, and snippets.

@ohcrider
Last active August 26, 2019 06:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ohcrider/93ce64ee9af9123fb4b27e81f65b7b8c to your computer and use it in GitHub Desktop.
Save ohcrider/93ce64ee9af9123fb4b27e81f65b7b8c to your computer and use it in GitHub Desktop.
page logic

小于等于页数7

  • 页数 5 1 2 3 4 5
  • 页数 6 1 2 3 4 5 6
  • 页数 7 1 2 3 4 5 6 7

大于页数7

示例一 (页数能整除

  • 页数 8 开头 1 2 3 4 ... 8
  • 页数 8 中间 1 ... 3 4 5 ... 8
  • 页数 8 结尾 1 ... 5 6 7 8

示例二 (页数不能整除 中间页数取整数部分 去掉小数点后面的

  • 页数 409 中间 1 ... 203 204 205 ... 409
  • 页数 409 开头 1 2 3 4 ... 409
  • 页数 409 结尾 1 ... 406 407 408 409
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment