ITPub博客

首页 > 应用开发 > > C#取余问题

C#取余问题

作者:cartoonfish 时间:2019-09-17 10:07:30 0 删除 编辑

写了一个分页小功能,但是计算出来的总页数有问题

listDepts.Count是184

int pageCount = listDepts.Count % 10 == 0 ? listDepts.Count % 10 : (listDepts.Count % 10) + 1;

 

pageCount为啥等于5

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/1409/viewspace-3153310/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2019-04-15

  • 博文量
    96
  • 访问量
    515