結果

問題 No.481 1から10
ユーザー uudjjsuudjjs
提出日時 2017-04-24 18:35:25
言語 C
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 325 bytes
コンパイル時間 108 ms
コンパイル使用メモリ 27,920 KB
実行使用メモリ 4,480 KB
最終ジャッジ日時 2023-10-11 13:17:55
合計ジャッジ時間 704 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 1 ms
4,348 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 0 ms
4,348 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: 関数 ‘main’ 内:
main.c:12:26: 警告: iteration 8 invokes undefined behavior [-Waggressive-loop-optimizations]
   12 |                 if (array[i + 1] - array[i] == 2)
      |                     ~~~~~^~~~~~~
main.c:10:22: 備考: within this loop
   10 |         for (i = 0;i <= 8;i++) {
      |                    ~~^~~~

ソースコード

diff #

#include <stdio.h>
int main(void) {

	int array[9];
	int j;
	for (j = 0;j < 9;j++) {
		scanf("%d", &array[j]);
	}
	int i;
	for (i = 0;i <= 8;i++) {

		if (array[i + 1] - array[i] == 2)
			printf("%d\n", array[i] + 1);
	}
	if (array[0] != 1)
		printf("%d\n", 1);

	else  if (array[i] != 10)
		printf("%d\n", 10);
		return 0;
}
0