Advertisement
Stefan08

varianta88_II_5

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