Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <algorithm>
- #include <bits/stdc++.h>
- using namespace std ;
- typedef long long ll ;
- void ABDEL3AL () {
- ios_base::sync_with_stdio(false) , cin.tie(nullptr) , cout.tie(nullptr) ;
- #ifndef ONLINE_JUDGE
- freopen("input.txt" , "r" ,stdin) , freopen("output.txt" , "w" , stdout) ;
- #endif
- }
- float average (double arr[] , int n) {
- float sum = 0 ;
- for (int i = 0; i < n; i++) sum += arr[i] ;
- return sum / n ;
- }
- int main() {
- ABDEL3AL() ;
- int n ;
- cin >> n ;
- double arr[n] ;
- for (int i = 0; i < n && cin >> arr[i]; i++);
- cout << fixed << setprecision(6) << average(arr , n) ;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment