Advertisement
Joporezka1

Third

May 13th, 2019
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.65 KB | None | 0 0
  1. //
  2. //  3.cpp
  3. //  12
  4. //
  5. //  Created by Алексей on 13/05/2019.
  6. //  Copyright © 2019 Алексей. All rights reserved.
  7. //
  8.  
  9. #include <iostream>
  10. #include <math.h>
  11. #include <cmath>
  12. #include <stdio.h>
  13. using namespace std;
  14. int main(){
  15.     int n;
  16.     cin>>n;
  17.     int maxi=0, b[n],counter=0;
  18.     for(int i=0; i<n; ++i){
  19.         cin>>b[i];
  20.     }
  21.     for(int i=0; i<n; ++i){
  22.         if(b[i]>maxi){
  23.             maxi=b[i];
  24.            
  25.         }
  26.     }
  27.     for(int i=0; i<n; ++i){
  28.         if(b[I]<=30){
  29.             counter++;
  30.         }
  31.     }
  32.     if(counter>0){
  33.         cout<<"YES";
  34.     }else{
  35.         cout<<"NO";
  36.     }
  37.     cout<<maxi;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement