SHARE
TWEET

Untitled

a guest Mar 26th, 2019 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. typedef long long ll;
  5.  
  6. #define sc1(a) scanf("%lld",&a)
  7. #define sc2(a,b) scanf("%lld %lld",&a,&b)
  8.  
  9. #define pf1(a) printf("%lld\n",a)
  10. #define pf2(a,b) printf("%lld %lld\n",a,b)
  11.  
  12. #define mx 100005
  13. #define mod 10000007
  14. #define Accepted 0
  15.  
  16. int main()
  17. {
  18.     int n;
  19.    
  20.     scanf("%d", &n);
  21.     int a[100][100];
  22.  
  23.     for (int i = 0; i < n; ++i)
  24.         for (int j = 0; j < n; ++j)
  25.             scanf("%d", &a[i][j]);
  26.  
  27.     for (int i = 0; i < 2*n-1; ++i)
  28.     {
  29.         for (int j = 0; j <= i && j < n; ++j)
  30.         {
  31.             int k = i - j;
  32.             if (k >= 0 && k < n)
  33.                 printf("%d ", a[k][j]);
  34.         }
  35.     }
  36.  
  37.  
  38.     return Accepted;
  39. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top