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