結果

問題 No.434 占い
ユーザー くれちーくれちー
提出日時 2016-10-14 22:57:58
言語 C90
(gcc 11.4.0)
結果
RE  
実行時間 -
コード長 423 bytes
コンパイル時間 179 ms
コンパイル使用メモリ 20,864 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-05-02 00:04:19
合計ジャッジ時間 3,377 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 0 ms
5,248 KB
testcase_01 AC 0 ms
5,376 KB
testcase_02 AC 0 ms
5,376 KB
testcase_03 AC 0 ms
5,376 KB
testcase_04 AC 1 ms
5,376 KB
testcase_05 AC 1 ms
5,376 KB
testcase_06 AC 1 ms
5,376 KB
testcase_07 AC 1 ms
5,376 KB
testcase_08 RE -
testcase_09 WA -
testcase_10 AC 2 ms
5,376 KB
testcase_11 AC 1 ms
5,376 KB
testcase_12 RE -
testcase_13 RE -
testcase_14 AC 9 ms
5,376 KB
testcase_15 RE -
testcase_16 RE -
testcase_17 WA -
testcase_18 AC 10 ms
5,376 KB
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 AC 1 ms
5,376 KB
testcase_24 RE -
testcase_25 RE -
testcase_26 RE -
testcase_27 RE -
testcase_28 RE -
testcase_29 RE -
testcase_30 RE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:6:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    6 |         scanf("%d", &t);
      |         ^~~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>

int main() {
	int t, s[1000], tmp, r[1000], i, j, k, l;

	scanf("%d", &t);
	getchar();
	for (i = 0; i < t; i++) {
		for (j = 0; (s[j] = getchar()) != '\n'; j++) {
			s[j] -= '0';
		}
		for (l = 0; l < j - 1; l++) {
			for (k = 0; k < j; k++) {
				tmp = s[k] + s[k + 1];
				if (tmp >= 10) tmp -= 9;
				s[k] = tmp;
			}
		}
		r[i] = s[0];
	}

	for (i = 0; i < t; i++) printf("%d\n", r[i]);
	return 0;
}
0