rotti321

T8 SIII ex 2

May 17th, 2021
599
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6.     int n, a[100][100],i,j,s=0;
  7.     cin>>n;
  8.     for(i=1;i<=n;i++)
  9.        for(j=1;j<=n;j++)
  10.           cin>>a[i][j];
  11.     for(i=1;i<=n;i++)
  12.        for(j=1;j<=n-1;j++)
  13.          if(i<j && i+j>n+1 )
  14.           s=s+a[i][j];
  15.     cout<<s;      
  16.     return 0;
  17. }
  18.  
RAW Paste Data