Submission #1010140

#TimeUsernameProblemLanguageResultExecution timeMemory
1010140AliHasanliPalindromes (info1cup18_palindromes)C++17
100 / 100
292 ms9884 KiB
#include<bits/stdc++.h>
using namespace std;
long long n,d,ans;
bool check(int a)
{
    int b=a,c=0;
    while(b)c=c*10+b%10,b/=10;
    return c==a;
}
int main()
{
    scanf("%d",&n);
    while(n--)
        {cin>>d;ans+=check(d)*d;}
    cout<<ans;
}

Compilation message (stderr)

palindromes.cpp: In function 'int main()':
palindromes.cpp:12:13: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'long long int*' [-Wformat=]
   12 |     scanf("%d",&n);
      |            ~^  ~~
      |             |  |
      |             |  long long int*
      |             int*
      |            %lld
palindromes.cpp:12:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   12 |     scanf("%d",&n);
      |     ~~~~~^~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...