SHARE
TWEET

Untitled

a guest Jan 23rd, 2020 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2.  
  3. using namespace std;
  4. int x,a[101][101],n,i,j,r,s1=0,s2=0;
  5. int main()
  6. {
  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=i+1;j<=n;j++)
  13.         s1=s1+a[i][j];
  14.    
  15.     for(i=1;i<=n;i++)
  16.         for(j=1;j<i;j++)
  17.         s2=s2+a[i][j];
  18.     while(s2!=0)
  19.     {
  20.         r=s1%s2;
  21.         s1=s2;
  22.         s2=r;
  23.     }
  24.     cout<<s1;
  25.     return 0;
  26. }
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