+ 3
How to make this with c++ ?
1 12 123 1234 12345=15
4 Answers
+ 10
assume you got the necessary thinga imported and the main function
cin>>row;
for (int i=0;i<row;i++){
for (int j=1;j<i+2;j++){
cout<<j;}
if (i<row-1){cout<<"\n";}
else{cout<<"="<<i*(i+1)/2;}
}
+ 2
@Pegasus thank you!
+ 2
One small correction: The "=" sign
+ 2
Hey mark the other one best answer!
I edited the code!