Pagini recente » Cod sursa (job #1121973) | Cod sursa (job #2678590) | Cod sursa (job #2873788) | Cod sursa (job #1934988) | Cod sursa (job #2986380)
/******************************************************************************
Welcome to GDB Online.
GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl,
C#, OCaml, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog.
Code, Compile, Run and Debug online from anywhere in world.
*******************************************************************************/
#include <bits/stdc++.h>
using namespace std;
ifstream fin("invers.in");
ofstream fout("invers.out");
int T, invers, sum, ca, cnt=0;
map <int,int> v[10005]
int main()
{
fin>>T;
for (int i=1; i<=T; ++i)
{
fin>>v[i];
}
for (int i=1; i<=T; ++i)
{
for (int j=1; j<=v[i];++j)
{
ca=j;
while (j!=0)
{
invers=invers*10+(j%10)
j/=10;
}
sum=ca+invers;
invers=0;
if (v[i]==sum)
{
fout>>"DA">>"\n";
cnt++;
}
}
if (cnt>=1)
{
continue;
}
if (cnt==0)
{
fout<<"NU"<<"\n";
}
}
return 0;
}