Submission #45496

#TimeUsernameProblemLanguageResultExecution timeMemory
45496IvanCPalindromes (info1cup18_palindromes)C++17
100 / 100
984 ms564 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main(){ ll soma = 0; int N; scanf("%d",&N); for(int vez = 1;vez<=N;vez++){ int x,copia; vector<int> V,U; scanf("%d",&x); copia = x; while(x != 0){ V.push_back(x % 10); U.push_back(x % 10); x /= 10; } reverse(U.begin(),U.end()); if(V == U) soma += copia; } printf("%lld\n",soma); return 0; }

Compilation message (stderr)

palindromes.cpp: In function 'int main()':
palindromes.cpp:7:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d",&N);
  ~~~~~^~~~~~~~~
palindromes.cpp:11:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d",&x);
   ~~~~~^~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...