Advertisement
Guest User

Untitled

a guest
Apr 6th, 2020
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.33 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int main() {
  4.   int n;
  5.   cin>>n;
  6.   for(int i=1; i<= n;i++)
  7.   {
  8.     for(int j=1;j<=n-(i-1);j++)
  9.     {
  10.       cout<<j<<" ";
  11.     }
  12.     cout<<endl;
  13.   }
  14.   cout<<endl;
  15.  for(int i=1; i<= n;i++)
  16.   {
  17.     for(int j=1;j<=i;j++)
  18.     {
  19.       cout<<j<<" ";
  20.     }
  21.     cout<<endl;
  22.   }
  23.  
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement