Răspunsuri

Cel mai inteligent răspuns!
2014-03-01T15:24:21+02:00
# include <iostream>

using namespace std;

int i, j, n, s;

int main()
{
    cout << "n = "; cin >> n;
    s = 0;
    j = 1;
    for ( i = 1 ; i <= n ; i++ )
    {
        s = s + j * i * i;
        j = -j;
    }
    cout << "s = " << s << endl;
    return 0;
}
1 5 1