复习一下进制转化,有点忘记了= =
#include<stdio.h>
int a[1005];
typedef long long ll;
int main()
{
/*
2
2
1000000000
*/ int k,j,flag;scanf("%d",&k);while(k--){ll n,t;scanf("%lld",&n);for(int b=2;;b++){j=0,t=n,flag=1;while(t){a[j]=t%b;t/=b;j++;}for(int i=0;i<j-1;i++){if(a[i+1]<=a[i]){flag=0;break;}}if(flag){printf("%d\n",b);break;}}}return 0;
}