S002-AC.cc 237 Bytes Edit Raw Blame History 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; }