Advertisement
Guest User

Untitled

a guest
Feb 27th, 2020
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement