当前位置: 代码迷 >> 综合 >> Floor problem
  详细解决方案

Floor problem

热度:69   发布时间:2024-01-09 00:01:38.0

题目网址:http://acm.fzu.edu.cn/problem.php?pid=2104

#include <cstdio>
#include <cmath>
int main()
{int t;int n, l, r;scanf("%d",&t);while(t--){scanf("%d%d%d",&n,&l,&r);double sum = 0;for(int i = l; i <= r; i++){sum+=floor(n*1.0/i);}printf("%.0lf\n",sum);}return 0;
}
  相关解决方案