Pagini recente » Cod sursa (job #2335592) | Cod sursa (job #2711156) | Cod sursa (job #2378582) | Cod sursa (job #1306191) | Cod sursa (job #2986382)
/******************************************************************************
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;
long long 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;
}