Skip to content

Instantly share code, notes, and snippets.

@smaznet
Created July 6, 2016 14:59
Show Gist options
  • Save smaznet/f0a78e52a1ca417b4aab2846a1fcdd65 to your computer and use it in GitHub Desktop.
Save smaznet/f0a78e52a1ca417b4aab2846a1fcdd65 to your computer and use it in GitHub Desktop.
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");}
}
}
@smaznet
Copy link
Author

smaznet commented Jul 6, 2016

یه خرده طول میکشه حساب کردنش

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment