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