#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[]) {
    int m, n, i;
    double sum = 0;
    printf("Please input a number:");
    scanf("%d", &m);
    printf("Please input another number:");
    scanf("%d", &n);
    if (m > n || m <= 0) // m大于0 且小于n 
        return 1;
    for(i=m;i<=n;i++)
        sum = sum + i*i + 1.0/i; // 必须是1.0,不然就成了整数运算,小数被舍弃 
    
    printf("∑= %.6lf", sum);
    return 0;
}