結果

問題 No.570 3人兄弟(その1)
ユーザー ya-ma-sa-kiya-ma-sa-ki
提出日時 2018-02-03 19:38:47
言語 C
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 779 bytes
コンパイル時間 141 ms
コンパイル使用メモリ 28,168 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-02 10:51:10
合計ジャッジ時間 750 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <limits.h>

int main(void){

  int num[3] = {0,0,0};
  int i = 0;
  int fst = 0;
  int scd = 0;
  int trd = INT_MAX;

  int fst_idx = 0;
  int scd_idx = 0;
  int trd_idx = 0;

  for(i=0;i<3;i++)
    scanf("%d", &num[i]);

  for(i=0;i<3;i++){
    if(num[i]>fst){
      fst = num[i];
      fst_idx = i;
    }
  }

  for(i=0;i<3;i++){
    if(num[i]<trd){
      trd = num[i];
      trd_idx = i;
    }
  }

  if(fst_idx == 0 && trd_idx == 1){
    printf("%d",fst);
    printf("%d",num[2]);
    printf("%d",trd);
  }

  if(fst_idx == 0 && trd_idx == 2){
    printf("%d",fst);
    printf("%d",num[1]);
    printf("%d",trd);
  }

  if(fst_idx == 1 && trd_idx == 2){
    printf("%d\n",fst);
    printf("%d\n",num[0]);
    printf("%d\n",trd);
  }

  return 0;
}
0