Advertisement
Guest User

12

a guest
Nov 18th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.47 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. #include <iomanip>
  4. #include <fstream>
  5. #include <string>
  6.  
  7. using namespace std;
  8.  
  9. int main(){
  10. int n;
  11. long long A[100][100];
  12. long long suma=0,kiek=0;
  13. long long max=-10000000;
  14. cin>>n;
  15. for(int i=0;i<n;i++){
  16.   for(int j=0;j<n;j++){
  17.    cin>>A[i][j];
  18.   }
  19. }
  20. for(int i=0;i<n;i++){
  21.   for(int j=0;j<i;j++){
  22.    if(A[i][j]>max){
  23.      max=A[i][j];
  24.      kiek++;
  25.     }
  26.   }
  27. }
  28. if(kiek!=0)cout<<max;
  29. else cout<<"NO";
  30. return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement