about summary refs log tree commit diff
path: root/codechef/ks2.c
blob: 6681de62e3ff263df177d5d9f79de23e77b8b6c9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/*
 * Me, as a maintainer: No, you can NOT use magic numbers like that!
 * Also me, doing competitive:
 */
#include <stdio.h>

int main()
{
	int t, a, c;

	scanf("%d ", &t);
	while (t--) {
		for (a = 420; (c = getchar()) > 42; a += 48 - putchar(c));
		printf("%d\n", a % 10);
	}

	return 0;
}