Cod sursa(job #48998)

Utilizator MirceampMuresan Mircea Paul Mirceamp Data 5 aprilie 2007 11:19:53
Problema Invers Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.6 kb
#include<fstream.h>
#include<math.h>

//using namespace std;

long long n,a[100],k,z;
int t,l;
int main()
{
    ifstream fin("invers.in");
    ofstream fout("invers.out");
    int i,j;
    fin>>t;
    for(i = 1; i <= t; i++)
    {
	fin>>n;z = n;
	while(n != 0)
	{
	    a[l++] = n%10;
	    n/=10;
	}
	if(a[0] == 0)
	{
	   for( j = 0; j < l; j++)
	       a[j] = a[j+1];
		l--;
         }
	     for( j = 0; j < l; j++)
	     k+=a[j]*(int)pow(10,(l-1)-j);
	     if(k > z)
	     fout<<"nu";
	     else
	     fout<<"da";
    }
    fin.close();
    fout.close();


return 0;

}