結果
問題 | No.570 3人兄弟(その1) |
ユーザー |
![]() |
提出日時 | 2018-03-11 15:56:38 |
言語 | C (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 2,000 ms |
コード長 | 722 bytes |
コンパイル時間 | 191 ms |
コンパイル使用メモリ | 28,928 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-15 00:18:53 |
合計ジャッジ時間 | 604 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 5 |
ソースコード
#include <stdio.h>struct Person{char name;int height;};int main(void){struct Person p[3];int i, k, t;char n;for(i = 0; i < 3; i++){scanf("%d", &p[i].height);p[i].name = 'A' + i;}do{k = 0;for(i = 0; i < 2; i++){if(p[i].height < p[i+1].height){t = p[i].height;p[i].height = p[i+1].height;p[i+1].height = t;n = p[i].name;p[i].name = p[i+1].name;p[i+1].name = n;k++;}}}while(k != 0);for(i = 0; i < 3; i++){printf("%c\n", p[i].name);}}