Advertisement
OMEGAHEAD_MonkoX

REALLY_COOL_Triangle

Nov 1st, 2019
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.51 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3. #include <cmath>
  4. using namespace std;
  5. int main()
  6. {
  7.     long long int n,i,j,m;
  8.     cin >> n;
  9.     vector < vector<long long int>> a(n, vector<long long int>(n));
  10.     for (i=0;i<n;++i)
  11.         for(j=0;j<n;++j)
  12.             cin >> a[i][j];
  13.     for (i=0;i<n;++i){
  14.         for (j=0;j<n;++j)
  15.         {
  16.             if (i<=n-j-1)
  17.             {
  18.                 printf("%2d",a[i][j]);
  19.                 cout<<" ";
  20.             }
  21.         }
  22.         cout<<endl;
  23.     }
  24.     return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement