Created
July 6, 2016 14:59
-
-
Save smaznet/f0a78e52a1ca417b4aab2846a1fcdd65 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
public class Ch2 | |
{ | |
public static void main(String[] vars){ | |
Scanner sc=new Scanner(System.in); | |
System.out.println("type n :\n"); | |
int n=sc.nextInt(); | |
System.out.println("type k :\n"); | |
calc(n,sc.nextInt()); | |
} | |
public static void calc(int n,int k){ | |
int a=100; | |
int ns=1; | |
while(a<1000000000){ | |
StringBuilder strb=new StringBuilder(String.valueOf((a*k))); | |
//System.out.println(strb.reverse().toString()); | |
if((Integer.valueOf(strb.toString()))==(Integer.valueOf((strb.reverse().toString())))*4) | |
{ | |
if(ns==n){ | |
System.out.println(strb.toString()); | |
break;} | |
ns++; | |
} | |
a++; | |
} | |
if(a>=1000000000){System.out.println("N");} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
یه خرده طول میکشه حساب کردنش