結果
| 問題 | No.419 直角三角形 |
| コンテスト | |
| ユーザー |
suppy193
|
| 提出日時 | 2016-09-12 10:50:50 |
| 言語 | C90 (gcc 12.4.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 234 bytes |
| 記録 | |
| コンパイル時間 | 238 ms |
| コンパイル使用メモリ | 29,508 KB |
| 最終ジャッジ日時 | 2026-02-23 22:22:28 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 20 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:7:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
7 | scanf("%d%d", &a, &b);
| ^~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
#include <math.h>
int main(void) {
int a, b;
double c;
scanf("%d%d", &a, &b);
if(a == b){
printf("%f\n", sqrt(a * a + b * b));
}
else {
c = sqrt(abs(a * a - b * b));
printf("%f\n", c);
}
return 0;
}
suppy193