Skip to content

Instantly share code, notes, and snippets.

@alonzoibarra97
Created April 5, 2016 09:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alonzoibarra97/e416424491f26cbb701698949fb5e729 to your computer and use it in GitHub Desktop.
Save alonzoibarra97/e416424491f26cbb701698949fb5e729 to your computer and use it in GitHub Desktop.
#include <iostream>
#include "BigIntegerLibrary.hh"
using namespace std;
int palindromos=0,nly=0, ly=0;
BigInteger s;
BigInteger reves (int num ){
int volt=0;
while(num>0)
{
volt= volt*10 + num%10;
num= num/10;
}
cout<<volt;
return volt;
}
int tipo (BigInteger numero)
{
int nume1, dvo, cont=0;
do{
s = reves(numero) + numero;
numero= s;
cont++;
}while(s!= reves(s)||cont<=30);
if (cont ==1)
{ return 1;
palindromos++;
}
else{
if(cont>1&& cont<30)
{
return 2;
nly++;
}
else{
return 3;
ly++;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment