結果
問題 |
No.419 直角三角形
|
ユーザー |
![]() |
提出日時 | 2016-09-10 00:29:24 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 272 bytes |
コンパイル時間 | 367 ms |
コンパイル使用メモリ | 30,464 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-16 19:05:41 |
合計ジャッジ時間 | 1,197 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 3 |
other | AC * 1 WA * 19 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:5:9: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 5 | scanf("%d,%d",&n,&m); | ~~~~~^~~~~~~~~~~~~~~
ソースコード
#include<stdio.h> #include<math.h> int main(void){ int n,m; scanf("%d,%d",&n,&m); if(n==m){ printf("%.7lf\n",sqrt(n*n+m*m)); }else if(n>m){ printf("%.7lf\n",sqrt(n*n-m*m)); }else if(m>n){ printf("%.7lf\n",sqrt(m*m-n*n)); } return 0; }