Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- // 3.cpp
- // 12
- //
- // Created by Алексей on 13/05/2019.
- // Copyright © 2019 Алексей. All rights reserved.
- //
- #include <iostream>
- #include <math.h>
- #include <cmath>
- #include <stdio.h>
- using namespace std;
- int main(){
- int n;
- cin>>n;
- int maxi=0, b[n],counter=0;
- for(int i=0; i<n; ++i){
- cin>>b[i];
- }
- for(int i=0; i<n; ++i){
- if(b[i]>maxi){
- maxi=b[i];
- }
- }
- for(int i=0; i<n; ++i){
- if(b[I]<=30){
- counter++;
- }
- }
- if(counter>0){
- cout<<"YES";
- }else{
- cout<<"NO";
- }
- cout<<maxi;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement