結果

問題 No.571 3人兄弟(その2)
ユーザー funakoshifunakoshi
提出日時 2019-08-27 17:14:07
言語 C
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 1,000 bytes
コンパイル時間 127 ms
コンパイル使用メモリ 31,104 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-27 18:06:33
合計ジャッジ時間 842 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,812 KB
testcase_01 WA -
testcase_02 AC 1 ms
6,940 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 1 ms
6,940 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <math.h>
int main(void)
{
    int height[3]={0};
    int weight[3]={0};
    int rank[3]={0,1,2};
    scanf("%d %d",&height[0],&weight[0]);
    scanf("%d %d",&height[1],&weight[1]);
    scanf("%d %d",&height[2],&weight[2]);
    for(int i=0;i<2;i++)
    {
        for(int j=i+1;j<3;j++)
        {
            if(height[i]<height[j])
            {
                rank[i]=j;
                rank[j]=i;
            }
            else if (height[i]==height[j])
            {
                if(weight[i]<weight[j])
                {
                    rank[i]=j;
                    rank[j]=i;
                }
            }
            
        }
    }
    for(int i=0;i<3;i++)
    {
        if(rank[i]==0)
        {
            printf("A");
        }
        else if (rank[i]==1)
        {
            printf("B");
        }
        else
        {
            printf("C");
        }
        printf("\n");
    }
}
0