Advertisement
Denistod

Untitled

Nov 16th, 2019
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. #include<iostream>
  2. #include<iomanip>
  3. using namespace std;
  4. int main()
  5. {
  6. int n,i,j,x,c=0,c1=0;
  7. double m=0,m1=0;
  8. for(i=1;i<=n;i++)
  9. {
  10. for(j=1;j<=n;j++)
  11. {
  12. cin>>x;
  13. if(i<j&&x>0)
  14. {
  15. m=m+x;
  16. c++;
  17. }
  18. if(i>j&&x>0)
  19. {
  20. m1=m1+x;
  21. c1++;
  22. }
  23. }
  24. }
  25. m=m/c;
  26. m1=m1/c1;
  27. cout<<fixed<<setprecision(2)<<m-m1;
  28. return 0;
  29. }
  30. 90
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement