solution.cpp 302 字节
Newer Older
每日一练社区's avatar
每日一练社区 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
#include <stdio.h>
#include <string.h>
#include <algorithm>
using namespace std;
int main()
{
    int i, j;
    long long int sum = 0;
    for (i = 1; i <= 100; i++)
    {
        int num = 0;
        for (j = 1; j <= i; j++)
            num += j;
        sum += num;
    }
    printf("%lld\n", sum);
}