結果

問題 No.432 占い(Easy)
ユーザー やまじゅんやまじゅん
提出日時 2017-06-22 16:08:17
言語 C
(gcc 12.3.0)
結果
RE  
(最新)
AC  
(最初)
実行時間 -
コード長 495 bytes
コンパイル時間 394 ms
コンパイル使用メモリ 29,568 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-10 10:29:11
合計ジャッジ時間 1,461 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,812 KB
testcase_01 AC 1 ms
6,940 KB
testcase_02 AC 1 ms
6,940 KB
testcase_03 AC 1 ms
6,940 KB
testcase_04 AC 1 ms
6,940 KB
testcase_05 AC 1 ms
6,944 KB
testcase_06 AC 1 ms
6,940 KB
testcase_07 AC 0 ms
6,944 KB
testcase_08 AC 1 ms
6,944 KB
testcase_09 AC 1 ms
6,944 KB
testcase_10 AC 1 ms
6,940 KB
testcase_11 AC 1 ms
6,940 KB
testcase_12 RE -
testcase_13 AC 1 ms
6,940 KB
testcase_14 AC 1 ms
6,940 KB
testcase_15 AC 1 ms
6,940 KB
testcase_16 AC 1 ms
6,940 KB
testcase_17 RE -
testcase_18 AC 1 ms
6,940 KB
testcase_19 AC 1 ms
6,944 KB
testcase_20 AC 1 ms
6,940 KB
testcase_21 AC 1 ms
6,940 KB
testcase_22 AC 0 ms
6,944 KB
testcase_23 AC 1 ms
6,940 KB
testcase_24 AC 1 ms
6,940 KB
testcase_25 AC 1 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>

#define MAX 1000

int main()
{
	int times, i,j;
	char numbers[MAX + 1];

	scanf("%d%*c", &times);

	for (i = 0;i < times;i++) {
		fgets(numbers, MAX + 1, stdin);
		
		for (j = 0;numbers[j] != '\n';j++);
		numbers[j] = '\0';

		while (numbers[1] != '\0') {
			for (j = 0;numbers[j + 1] != '\0';j++) {
				numbers[j] += numbers[j + 1] - '0';
				if (numbers[j] >= ':') {
					numbers[j] -= 9;
				}
			}
			numbers[j] = '\0';
		}

		printf("%c\n", numbers[0]);
	}

	return 0;
}
0