Zadatak3.10-Supersume

#include <iostream>

using namespace std;

int main()
{
unsigned long long int i,n,s,s1;
cin>>n;
s=0;
i=1;
while(i>=1&& i<=n)
{
s1=i*(i+1)/2;
s=s+s1;
i++;
}
cout<<s;
return 0;
}

Advertisements