Problem description
1221 is a very special number, it reads from the left and reads from the right is the same, programming for all such four-bit decimal numbers.
Output format
The four-bit decimal number that satisfies the condition is output in order from small to large.
Import java.util.*; Class main{ Public Static void Main(string[] args) {inta[]=New int[4]; for(intI=1;i<Ten; i++) { for(intj=0;j<Ten; j + +) {a[0]=a[3]=i; a[1]=a[2]=j;intlast=a[0]* ++a[1]* -+a[2]*Ten+a[3]; System. out. println (last); }}}----------------------import java.util.*; Class main{ Public Static void Main(string[] args) {ArrayList <Integer> s =NewArraylist<integer> ();inta[]=New int[4]; for(intI=1;i<Ten; i++) { for(intj=0;j<Ten; j + +) {a[0]=a[3]=i; a[1]=a[2]=j;intlast=a[0]* ++a[1]* -+a[2]*Ten+a[3]; S.add (last); }} collections.sort (s); for(intI=0; I<s.size (); i++) {System. out. println (S.Get(i)); } }}
Palindrome Series 2