結果

問題 No.394 ハーフパイプ(1)
ユーザー TwinkleStar74
提出日時 2017-09-30 19:47:04
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 709 bytes
コンパイル時間 3,651 ms
コンパイル使用メモリ 75,548 KB
実行使用メモリ 41,360 KB
最終ジャッジ日時 2024-11-15 20:55:59
合計ジャッジ時間 5,855 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 6 WA * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;

public class No394 {
	
	public static void main(String[] args) {
		try{
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			String[] temp = br.readLine().split(" ");
			int[] points = new int[temp.length];
			
			for(int i =0; i < temp.length; i++)
				points[i] = Integer.parseInt(temp[i]);
			System.out.printf("%.2f",getAve(points));
			
		}catch(Exception e){
			e.getStackTrace();
		}
	}
	
	
	public static double getAve(int[] x){
		Arrays.sort(x);
		int sum = 0;
		double ave = 0;
		for(int i=1; i < x.length - 1; i++)
			sum += x[i];
		ave = sum / (x.length - 2);
		return ave;
	}
}
0