Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int a[21][21];
- int main()
- {
- int i,j,n,m=0,nr=0;
- cin>>n;
- for(i=1;i<=n;i++)
- {
- for(j=1;j<=n;j++)
- {
- cin>>a[i][j];
- if(i<j && a[i][j]>0)
- {
- m+=a[i][j];
- nr++;
- }
- }
- }
- if(nr!=0)
- {
- cout<<(double) m/nr;
- }
- else
- {
- cout<<"NU EXISTA";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement