+ 3

How to make this with c++ ?

1 12 123 1234 12345=15

16th Oct 2017, 2:58 AM
Syi fa
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;} }
16th Oct 2017, 3:09 AM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
+ 2
@Pegasus thank you!
16th Oct 2017, 3:42 AM
Syi fa
+ 2
One small correction: The "=" sign
16th Oct 2017, 9:01 AM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
+ 2
Hey mark the other one best answer! I edited the code!
16th Oct 2017, 9:05 AM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar