SHARE
TWEET

Untitled

a guest Feb 27th, 2020 77 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. {
  7.     int a,b,c,l;
  8.     float d=0,chuj=0;
  9.  
  10.     cin>>a;
  11.     int t[a][a];
  12.     for(int i=0;i<a;i++)
  13.     {
  14.         for(int j=0;j<a;j++){
  15.         cin>>t[i][j];
  16.         if(i==j){
  17.             d+=t[i][j];
  18.             l++;
  19.         }
  20.         }
  21.  
  22.     }
  23.     for(int i=0;i<a;i++)
  24.     {
  25.         for(int j=0;j<a;j++){
  26.         cout<<t[i][j];
  27.         }
  28.         cout<<endl;
  29.     }
  30.     cout<<endl;
  31.     chuj=d/l;
  32.     cout<< chuj;
  33.     return 0;
  34. }
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