結果

問題 No.419 直角三角形
ユーザー くれちー
提出日時 2016-11-20 00:12:02
言語 C90
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 222 bytes
コンパイル時間 279 ms
コンパイル使用メモリ 23,552 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-27 06:31:02
合計ジャッジ時間 1,048 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 17 WA * 3
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:6:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    6 |         scanf("%d %d", &a, &b);
      |         ^~~~~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>
#include <math.h>

int main() {
	int a, b;
	scanf("%d %d", &a, &b);

	int big = a > b ? a : b, small = a < b ? a : b;
	double ans = sqrt(big * big - small * small);

	printf("%.7lf\n", ans);
	return 0;
}
0