fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int n;
  6. cin>>n;
  7.  
  8.  
  9. for(int i=1; i<+n; i++){
  10. for(int a =n;a>i;a--){
  11. cout <<" ";
  12. }
  13. for(int e=1; e < n; e++){
  14. cout<<e;
  15. for(int m =0;m<e;m++){
  16. cout <<" ";
  17.  
  18.  
  19. }
  20. cout << endl;
  21. cout << e;
  22.  
  23.  
  24. }
  25.  
  26. cout<<endl;
  27. //
  28.  
  29.  
  30. }
  31. return 0;
  32. }
Success #stdin #stdout 0.01s 5328KB
stdin
8
stdout
       1 
12  
23   
34    
45     
56      
67       
7
      1 
12  
23   
34    
45     
56      
67       
7
     1 
12  
23   
34    
45     
56      
67       
7
    1 
12  
23   
34    
45     
56      
67       
7
   1 
12  
23   
34    
45     
56      
67       
7
  1 
12  
23   
34    
45     
56      
67       
7
 1 
12  
23   
34    
45     
56      
67       
7