結果

問題 No.965 門松列が嫌い
ユーザー suppy193suppy193
提出日時 2021-05-02 11:23:30
言語 C90
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 358 bytes
コンパイル時間 785 ms
コンパイル使用メモリ 23,660 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-28 01:17:37
合計ジャッジ時間 1,959 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#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;
}
0