Advertisement
elephantsarecool

3pol

Jan 11th, 2018
143
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. {
  5.     int a[1000][1000];
  6.     int n,answer=1;
  7.     cin>>n;
  8.     for(int i=0;i<n;++i)
  9.         for(int j=0;j<n;++j)
  10.             cin>>a[i][j];
  11.     for(int i=0;i<n;++i)
  12.         for(int j=i+1;j<n;++j)
  13.             if((i+j)%2==0)answer*=a[i][j];
  14.     cout<<answer<<endl;
  15.     return 0;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement