Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int a,b,c,l;
- float d=0,chuj=0;
- cin>>a;
- int t[a][a];
- for(int i=0;i<a;i++)
- {
- for(int j=0;j<a;j++){
- cin>>t[i][j];
- if(i==j){
- d+=t[i][j];
- l++;
- }
- }
- }
- for(int i=0;i<a;i++)
- {
- for(int j=0;j<a;j++){
- cout<<t[i][j];
- }
- cout<<endl;
- }
- cout<<endl;
- chuj=d/l;
- cout<< chuj;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement