답안 #407371

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
407371 2021-05-18T19:48:57 Z rainboy Pot (COCI15_pot) C
50 / 50
1 ms 280 KB
#include <stdio.h>

int power(int a, int k) {
	return k == 0 ? 1 : power(a, k - 1) * a;
}

int main() {
	int n, ans;

	scanf("%d", &n);
	ans = 0;
	while (n--) {
		int a;

		scanf("%d", &a);
		ans += power(a / 10, a % 10);
	}
	printf("%d\n", ans);
	return 0;
}

Compilation message

pot.c: In function 'main':
pot.c:10:2: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   10 |  scanf("%d", &n);
      |  ^~~~~~~~~~~~~~~
pot.c:15:3: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   15 |   scanf("%d", &a);
      |   ^~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 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 280 KB Output is correct
9 Correct 1 ms 204 KB Output is correct
10 Correct 1 ms 204 KB Output is correct