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