fork download
  1. class M
  2. {
  3. static int c(int a)
  4. {
  5. int x = a;
  6. while(!(x+"").equals(new StringBuffer(x+"").reverse()+""))
  7. x += a;
  8. return x;
  9. }
  10.  
  11. public static void main(String[] a){
  12. System.out.println(c(1));
  13. System.out.println(c(2));
  14. System.out.println(c(16));
  15. System.out.println(c(17));
  16. System.out.println(c(42));
  17. System.out.println(c(111));
  18. System.out.println(c(302));
  19. System.out.println(c(1234));
  20. }
  21. }
Success #stdin #stdout 0.05s 320576KB
stdin
Standard input is empty
stdout
1
2
272
272
252
111
87278
28382