Răspuns :

#include <iostream>

using namespace std;

int main()

{unsigned int n,i,S;

cin>>n;

S=n*(n+1)/2;

cout<<"Suma 1+2+3+...+"<<n<<" este "<<S<<endl;

return 0;

}

unsigned int n;

cin>>n;

cout<<n*(n+1)/2;

return 0;