Advertisement
Denistod

Untitled

Nov 16th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 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;
  7. double s=0;
  8. cin>>n;
  9. for(i=1;i<=n;i++)
  10. {
  11. for(j=1;j<=n;j++)
  12. {
  13. cin>>x;
  14. if(i<j&&x>0)
  15. {
  16. s=s+x;
  17. c++;
  18. }
  19. }
  20. }
  21. if(s!=0)
  22. {
  23. cout<<fixed<<setprecision(2)<<s/c;
  24. }
  25. else
  26. {
  27. cout<<"NU EXISTA";
  28. }
  29. return 0;
  30. }
  31. 88
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement