結果
| 問題 |
No.965 門松列が嫌い
|
| コンテスト | |
| ユーザー |
suppy193
|
| 提出日時 | 2021-05-02 11:25:35 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 1,000 ms |
| コード長 | 368 bytes |
| コンパイル時間 | 229 ms |
| コンパイル使用メモリ | 20,864 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-20 19:56:37 |
| 合計ジャッジ時間 | 843 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 9 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:8:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
8 | scanf("%d%d%d", &a, &b, &c);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
#include <stdlib.h>
int main(void) {
int a, b, c;
int ba, bc, ac;
scanf("%d%d%d", &a, &b, &c);
ba = abs(b - a);
bc = abs(b - c);
ac = abs(a - c);
if(ba > bc){
if(bc > ac){
printf("%d\n", ac);
}
else{
printf("%d\n", bc);
}
}
else{
if(ba < ac){
printf("%d\n", ba);
}
else{
printf("%d\n", ac);
}
}
return 0;
}
suppy193