This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <iostream>
using namespace std;
int palindrom (int x)
{
int p=1,nr=0;
if (x%10==0) return 0;
while (x>=p)
{
p=p*10;
nr=nr*10+x%10;
if (nr==x) return 1;
x=x/10;
}
if (x==nr)
return 1;
return 0;
}
int n,i;
int unsigned long long s,a;
int main()
{
cin>>n;
for (i=1; i<=n; i++)
{
cin>>a;
if (palindrom(a)) s=s+a;
}
cout<<s;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |