結果

問題 No.394 ハーフパイプ(1)
ユーザー Force_AccessForce_Access
提出日時 2016-07-20 11:32:43
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 734 bytes
コンパイル時間 3,609 ms
コンパイル使用メモリ 74,652 KB
実行使用メモリ 41,596 KB
最終ジャッジ日時 2024-04-23 16:59:50
合計ジャッジ時間 5,728 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
import java.text.DecimalFormat;

public class Study01 {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String a = sc.nextLine();
		String [] b = a.split(" ");
		int [] c = new int[6];
		int max = 0,min = 10000;
		for(int i=0;i<b.length;i++){
			c[i] = Integer.parseInt(b[i]);
			System.out.println(c[i]);
			max = Math.max(max,c[i]);
			min = Math.min(min,c[i]);
		}
		DecimalFormat format = new DecimalFormat("#.#");
		format.setMinimumFractionDigits(2);
		format.setMaximumFractionDigits(2);
		int answer = 0;
		for(int i=0;i<6;i++){
			answer += c[i];
		}
		int hiki = max + min;
		answer = answer - hiki;
		answer /= 4;
		System.out.println(format.format(answer));
	}
}
0