Basic Practice Special Palindrome numberTime limit: 1.0s memory Limit: 512.0MB problem description 123321 is a very special number, it reads from the left and reads from the right is the same.
Enter a positive integer n, programming all such five-bit and six-bit decimal numbers to satisfy the sum of the numbers equal to N. Enter a line in the format that contains a positive integer n. The output format outputs an integer that satisfies the condition in order from small to large, with each integer occupying one row. Example input 52 sample output 899998
989989
998899 Data size and convention 1<=n<=54.
ImportJava.util.*; Public classMain {Static intn = 0; Public Static voidMain (string[] args) {inti; Scanner Cin=NewScanner (system.in); N=Cin.nextint (); for(i = 10001; i< 999999; i++ ){ if(Huiwen (i)) System.out.println (i); } } Static BooleanHuiwen (intx) { intI,s,j=0; intA[] =New int[8]; while(x>0) {a[j++]=x%10; X/=10; } for(i=0; i<=j/2; i++) { if(A[i]!=a[j-1-i])return false; } for(i=0,s=0; i<j; i++) {s+=A[i]; } if(s==n)return true; Else return false; }}
Basic Practice Special Palindrome number