Created
January 17, 2019 02:27
-
-
Save godtaehee/06933282955aacfff7a4171f3cbeeab5 to your computer and use it in GitHub Desktop.
C++
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main(){ | |
cin.tie(NULL); | |
ios_base::sync_with_stdio(false); | |
double max, sum =0; | |
int N; | |
cin >> N; | |
int a[N]; | |
for(int i = 0; i < N; i++) | |
cin >> a[i]; | |
max = a[0]; | |
for(int i = 0; i < N; i++){ | |
if(a[i] > max) | |
max = a[i]; | |
} | |
for(int i = 0; i < N; i++) | |
sum += (a[i] / max) * 100; | |
cout << sum / N; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment