Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<iomanip>
- using namespace std;
- int main()
- {
- int n,i,j,x,c=0,c1=0;
- double m=0,m1=0;
- for(i=1;i<=n;i++)
- {
- for(j=1;j<=n;j++)
- {
- cin>>x;
- if(i<j&&x>0)
- {
- m=m+x;
- c++;
- }
- if(i>j&&x>0)
- {
- m1=m1+x;
- c1++;
- }
- }
- }
- m=m/c;
- m1=m1/c1;
- cout<<fixed<<setprecision(2)<<m-m1;
- return 0;
- }
- 90
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement