Răspuns:
Tu ai scris: S=1*2+ 2*3+ 3*4+ ........+n*(n-1)
asa ca am pus s = s + i*(i-1)
#include <iostream>
using namespace std;
int main() {
// Write C++ code here
int s,n;
s=0;
cin >> n;
for(int i = 0; i <= n; i++){
s=s+(i*(i-1));
}
cout << s;
return 0;
}