結果

問題 No.570 3人兄弟(その1)
ユーザー Kainogi_Kainogi_
提出日時 2017-10-27 07:34:07
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 429 bytes
コンパイル時間 386 ms
コンパイル使用メモリ 52,008 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-14 02:40:45
合計ジャッジ時間 914 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include <iostream>
using namespace std;
struct P{char suit;int value;};
int main(void){
    struct P p[4];
    int i,j,max;
    p[0].suit='A',p[1].suit='B',p[2].suit='C';
    for(i=0;i<3;i++){
        cin>>p[i].value;
    }
    for(i=0;i<2;i++){
        max=i;
        for(j=2;j>=i;j--)if(p[max].value<p[j].value)max=j;
        swap(p[i],p[max]);
    }
    for(i=0;i<3;i++){
        cout<<p[i].suit<<endl;
    }
    return 0;
}
0