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(i=1;i<=n;i++){
  8. for(j=1;j<=n+(n-1);j++){
  9. if((j>n&&j-n>=i)||j+i<=n)cout<<" ";
  10. else cout<<-abs(n-j)+n-(n-i);
  11. }
  12. cout<<"\n";
  13. }
  14. return 0;
  15. }
Success #stdin #stdout 0.01s 5320KB
stdin
Standard input is empty
stdout
    1    
   121   
  12321  
 1234321 
123454321