結果

問題 No.419 直角三角形
ユーザー notetonous
提出日時 2016-09-10 00:18:03
言語 C90
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 338 bytes
コンパイル時間 659 ms
コンパイル使用メモリ 24,064 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-11-16 18:59:35
合計ジャッジ時間 1,636 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 17 WA * 3
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:15:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   15 |   scanf("%d %d",&a,&b);
      |   ^~~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>
#include <math.h>
int min(int a,int b){
  return a<b?a:b;
}
int max(int a,int b){
  return a<b?b:a;
}
double min2(double a,double b){
  return a<b?a:b;
}
int main(){
  int a,b;
  int l1,l2;
  scanf("%d %d",&a,&b);
  l1=min(a,b);
  l2=max(a,b);
  printf("%lf\n",min2(sqrt(l1*l1+l2*l2),sqrt(l2*l2-l1*l1)));
  return 0;
}
0