結果

問題 No.419 直角三角形
ユーザー AoiroFukurou
提出日時 2016-12-18 14:14:41
言語 Java
(openjdk 23)
結果
AC  
実行時間 133 ms / 1,000 ms
コード長 399 bytes
コンパイル時間 4,757 ms
コンパイル使用メモリ 74,184 KB
実行使用メモリ 41,540 KB
最終ジャッジ日時 2024-12-14 08:20:52
合計ジャッジ時間 7,882 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder;

import java.util.Scanner;

public class No_419 {
public static void main(String[] args) {
	Scanner sc = new Scanner(System.in);
	int a = sc.nextInt();
	int b = sc.nextInt();
	sc.close();
	if(a == b){
		double c = a * Math.sqrt(2);
		System.out.println(c);
	}else{
	double abs = Math.abs(Math.pow(a, 2) - Math.pow(b, 2));
	double c = Math.sqrt(abs);
	System.out.println(c);
	}
}
}
0