Advertisement
Anik_Akash

Untitled

Feb 13th, 2021
502
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.43 KB | None | 0 0
  1. void seris(int s, int e)
  2. {
  3.     if(s==0)return;
  4.    
  5.     seris(s-1, e);
  6.     printf("%d ", s);
  7.    
  8. }
  9.  
  10. int main()
  11. {
  12.     int n, t;
  13.     cin>>n;
  14.     t = n;
  15.    
  16.     while (t--)
  17.     {
  18.        
  19.         if(t==n-1)
  20.         {
  21.             seris(n,1);  
  22.             printf("\n");
  23.         }
  24.         else {
  25.             n-=1;
  26.              seris(n,1);  
  27.              printf("\n");
  28.         }
  29.     }
  30.    
  31.    
  32.     return 0;
  33. }
  34.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement