Răspuns :
Răspuns:
Salut! :)
include <iostream>
using namespace std
int main()
{
int n, i;
long long s=0;
cin>>n;
for (i=1; i<=n; i++)
s=s+(i*(i+1));
cout<<s;
return 0;
}
Sper ca te ajuta.
Succes! ♡︎♥︎♡︎
#include <iostream>
using namespace std;
int main()
{
unsigned int n, S = 0;
cin >> n;
for (int i = 1; i <= n; i++)
{
S = S + i * (i + 1);
}
cout << S;
}