답안 #448528

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
448528 2021-07-30T12:04:24 Z rainboy Bridž (COCI17_bridz) C
50 / 50
2 ms 460 KB
#include <stdio.h>

int main() {
	int n, sum;

	scanf("%d", &n);
	sum = 0;
	while (n--) {
		static char cc[16];
		int i;

		scanf("%s", cc);
		for (i = 0; i < 13; i++)
			if (cc[i] == 'A')
				sum += 4;
			else if (cc[i] == 'K')
				sum += 3;
			else if (cc[i] == 'Q')
				sum += 2;
			else if (cc[i] == 'J')
				sum += 1;
	}
	printf("%d\n", sum);
	return 0;
}

Compilation message

bridz.c: In function 'main':
bridz.c:6:2: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
    6 |  scanf("%d", &n);
      |  ^~~~~~~~~~~~~~~
bridz.c:12:3: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   12 |   scanf("%s", cc);
      |   ^~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
4 Correct 0 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 1 ms 460 KB Output is correct
10 Correct 2 ms 332 KB Output is correct