|
Radbug
SUPREME DRINKER

| Joined: 16 Oct 2009 |
| Posts: 17 |
|
|
 |
#include <iostream.h>
#include <fstream.h>
ifstream fin("permutare.in");
ofstream fout("permutare.out");
unsigned long lg,x,i,n,d,ok,rest,p,cifra;
int main()
{
fin>>n;
x=n;
lg=0;
if (d=0)
lg=1;
else
while(x>0)
{
lg=lg+1;
x=x/10;
}
{
i=0;
p=p*10;
x=n;
ok=0;
i=0;
}
while ((i<lg-1) && (ok=0))
{
cifra=n/p;
rest=n*p;
x=rest*10+cifra;
i=i+1;
if(x=n)
ok=1;
}
if(ok>0)
fout<<"NU";
else
{
fout<<"DA"<< '\n';
fout<<i;
}
return 0;
fin.close();
fout.close();
}
|
|
|
|