Created
June 25, 2012 06:31
-
-
Save Onjanirina/2986994 to your computer and use it in GitHub Desktop.
Solution for 200B - Drinks on CodeForces (Round 126, Div2)
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
/** | |
* CodeForces - Round 126 (Div2) - Problem B - Drinks | |
* http://codeforces.com/contest/200/problem/B | |
*/ | |
import java.io.*; | |
/** | |
* */ | |
public class Solution { | |
/** | |
* @param args | |
*/ | |
public static void main(String[] args){ | |
try { | |
BufferedReader reader =new BufferedReader( new InputStreamReader( System.in)); // STDIN | |
Integer nDrinks=Integer.valueOf(reader.readLine().trim()); | |
Integer[] percentages=new Integer[nDrinks]; | |
Integer sum=0; | |
String[] str=reader.readLine().trim().split(" ",nDrinks); | |
for(int i=0;i!=str.length;i++){ | |
percentages[i]=Integer.valueOf(str[i].trim()); | |
sum+=percentages[i]; } | |
System.out.println((double)sum/percentages.length); | |
}catch(Exception e){ | |
e.printStackTrace(System.err); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment