Submission #407371

#TimeUsernameProblemLanguageResultExecution timeMemory
407371rainboyPot (COCI15_pot)C11
50 / 50
1 ms280 KiB
#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 (stderr)

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);
      |   ^~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...