long tmpA=0,tmpB=0; for(int i=1; i<=100; i++){ tmpA += i*i; tmpB +=i; } cout << tmpB*tmpB - tmpA <<endl;