Submission #881783

#TimeUsernameProblemLanguageResultExecution timeMemory
881783rainboyPalindromes (info1cup18_palindromes)C11
100 / 100
140 ms10068 KiB
#include <stdio.h> int rev(int a) { int b = 0; while (a > 0) { b = b * 10 + a % 10; a /= 10; } return b; } int main() { int n; long long sum; scanf("%d", &n); sum = 0; while (n--) { int a; scanf("%d", &a); if (a == rev(a)) sum += a; } printf("%lld\n", sum); return 0; }

Compilation message (stderr)

palindromes.c: In function 'main':
palindromes.c:17:2: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   17 |  scanf("%d", &n);
      |  ^~~~~~~~~~~~~~~
palindromes.c:22:3: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   22 |   scanf("%d", &a);
      |   ^~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...