Advertisement
Joporezka1

4

May 13th, 2019
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.64 KB | None | 0 0
  1. //
  2. //  4.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 b[n],counter=0, summ=0;
  18.     float midi;
  19.     for(int i=0; i<n; ++i){
  20.         cin>>b[i];
  21.     }
  22.     for(int i=0; i<n; ++i){
  23.         summ+=b[i];
  24.     }
  25.     for(int i=0; i<n; ++i){
  26.         if(b[i]<=40){
  27.             counter++;
  28.         }
  29.     }
  30.     if(counter>1){
  31.         cout<<"YES";
  32.     }else{
  33.         cout<<"NO";
  34.     }
  35.     midi=summ/n;
  36.     cout<<midi;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement