Blame view

P36668_en/S002-AC.cc 237 Bytes
Imanol-Mikel Barba Sabariego authored
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <iostream>

using namespace std;

int main()
{
        int a,sum = 0;
        cin >> a;
        for(int i = 0; i < a; i++)
        {
                sum += (i+1)*(i+1);
        }
        cout << sum << endl;
        return 0;
}