結果
| 問題 | No.419 直角三角形 |
| コンテスト | |
| ユーザー |
issekiamp
|
| 提出日時 | 2016-12-18 14:26:50 |
| 言語 | C90 (gcc 12.4.0) |
| 結果 |
CE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 404 bytes |
| 記録 | |
| コンパイル時間 | 380 ms |
| コンパイル使用メモリ | 22,344 KB |
| 最終ジャッジ日時 | 2026-01-06 01:41:26 |
| 合計ジャッジ時間 | 1,267 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
main.c: In function ‘main’:
main.c:6:9: error: C++ style comments are not allowed in ISO C90
6 | // your code goes here
| ^
main.c:6:9: note: (this will be reported only once per input file)
main.c:11:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
11 | scanf("%d %d" , &hen1, &hen2);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main(void) {
// your code goes here
int hen1,hen2;
int temp1,temp2;
double hen3;
scanf("%d %d" , &hen1, &hen2);
temp1 = hen1*hen1 + hen2*hen2;
temp2 = abs(hen1*hen1 - hen2*hen2);
if ((temp1 < temp2) || (temp2 == 0)) {
hen3 = sqrt((double)temp1);
} else {
hen3 = sqrt((double)temp2);
}
printf("%.10f\n", hen3);
return 0;
}
issekiamp