fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. // your code goes here
  6. int n=5,i,j;
  7. for(i=1;i<=n;i++){
  8. for(j=1;j<=2*n-1;j++){
  9. if(i>=n-j) cout<<j;
  10. else cout<<" ";
  11.  
  12. }
  13. cout<<"\n";
  14. }
  15. return 0;
  16. }
Success #stdin #stdout 0.01s 5320KB
stdin
Standard input is empty
stdout
   456789
  3456789
 23456789
123456789
123456789