結果
問題 | No.965 門松列が嫌い |
ユーザー |
![]() |
提出日時 | 2021-05-02 11:23:30 |
言語 | C90 (gcc 12.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 358 bytes |
コンパイル時間 | 149 ms |
コンパイル使用メモリ | 20,864 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-20 19:54:38 |
合計ジャッジ時間 | 774 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 4 WA * 5 |
コンパイルメッセージ
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 = b - a; bc = 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; }