結果

問題 No.2920 Blood Type
ユーザー pengin_2000pengin_2000
提出日時 2024-10-12 16:34:48
言語 C
(gcc 13.3.0)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 617 bytes
コンパイル時間 576 ms
コンパイル使用メモリ 28,288 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-10-12 16:34:50
合計ジャッジ時間 1,135 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 36
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<stdio.h>
int main()
{
	char s[4], t[4];
	scanf("%s%s", s, t);
	int a, b, ab, o;
	a = b = ab = o = 0;
	int i, j;
	for (i = 0; i < 2; i++)
	{
		for (j = 0; j < 2; j++)
		{
			if (s[i] == 'A')
			{
				if (t[j] == 'A')
					a += 25;
				else if (t[j] == 'B')
					ab += 25;
				else
					a += 25;
			}
			else if (s[i] == 'B')
			{
				if (t[j] == 'A')
					ab += 25;
				else if (t[j] == 'B')
					b += 25;
				else
					b += 25;
			}
			else
			{
				if (t[j] == 'A')
					a += 25;
				else if (t[j] == 'B')
					b += 25;
				else
					o += 25;
			}
		}
	}
	printf("%d %d %d %d\n", a, b, ab, o);
	return 0;
}
0