include
include
using namespace std;
string str;int t,flag,temp;
int main()
{
int check(long);
int palin(string);
cin>>t;
long arr[t];
for(int i=0;i {
cin>>arr[i];
}
for(int i=0;i {
temp=arr[i];
flag=check(arr[i]);
cout< }
}
int check(long num)
{
int palin(string);
int con=0,n=2;
while(con!=1)
{
str="";
num=temp;
while(num>0)
{
str=to_string(num%n)+str;
num=num/n;
}
con=palin(str);
n++;
}
return --n;
}
int palin(string st)
{
int tr=1,l=st.length()-1;
for(int i=0;i<=l;i++)
{
if(st[i]!=str[l-i])
{
tr=0;
break;
}
}
return tr;
}
It says that to_string is not declaerd. Well i used the string header file, so what's wrong??