about summary refs log tree commit diff
path: root/2ndary/12/Q-VĩnhTường-2006/cau1.c
blob: 173e7c2c9cc2e7eb5b772bf4f406eb7acf4d852c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <stdio.h>
#include <string.h>

int main()
{
	char b[100], i;
	short a = 0;

	scanf("%s", b);

	for (i = strlen(b) - 1; i >= 0; i -= 2)
		a += b[i] - 48;

	for (i = strlen(b) - 2; i >= 0; i -= 2)
		a += b[i] * 2 - 96;

	printf("%d\n", a % 3);

	return 0;
}