結果
| 問題 |
No.570 3人兄弟(その1)
|
| コンテスト | |
| ユーザー |
extelo
|
| 提出日時 | 2017-11-21 18:49:01 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 497 bytes |
| コンパイル時間 | 253 ms |
| コンパイル使用メモリ | 28,032 KB |
| 最終ジャッジ日時 | 2025-01-05 04:16:56 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 2 |
| other | WA * 5 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:15:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
15 | scanf("%d", &a[0].height);
| ~~~~~^~~~~~~~~~~~~~~~~~~~
main.cpp:16:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
16 | scanf("%d", &a[1].height);
| ~~~~~^~~~~~~~~~~~~~~~~~~~
main.cpp:17:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
17 | scanf("%d", &a[2].height);
| ~~~~~^~~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
class inf
{
public:
int height;
char name;
};
int main(void)
{
inf a[3];
scanf("%d", &a[0].height);
scanf("%d", &a[1].height);
scanf("%d", &a[2].height);
a[0].name = 'A';
a[0].name = 'B';
a[0].name = 'C';
for(int i=0; i<3; i++){
for(int j=i+1; j<3; j++){
if(a[i].height<a[j].height){
inf temp = a[j];
a[j] = a[i];
a[i] = temp;
}
}
}
for(int i=0;i<3;i++){
printf("%c\n", a[i].name);
}
return 0;
}
extelo