Răspunsuri

2014-10-21T21:59:28+03:00
# include<iostream>
using namespace std;
int inv,s,c;
int main()
{
    unsigned n,v[500],i;
    cin>>n;
    for(i=1;i<=n;i++)
       cin>>v[i];
    for(i=1;i<=n;i++)
    {
      inv=0;
      c=v[i];
      while(v[i]>0)
      {
        inv=inv*10+v[i]%10;
        v[i]=v[i]/10;
      }
      if(c==inv)
         s=s+c;
    }

    cout<<s;
    return 0;

}