FZU 2104 Floor problem

题意:求向下取整的和
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;

int n,L,R;

int main(){
    int t;
    scanf("%d",&t);
    while (t--){
        scanf("%d%d%d",&n,&L,&R);
        int sum = 0;
        for (int i = L; i <= R; i++)
            sum += n/i;
        printf("%d\n",sum);
    }
    return 0;
}



你可能感兴趣的:(FZU 2104 Floor problem)