Skip to content

Instantly share code, notes, and snippets.

@dalcon10028
Created December 29, 2019 14:19
Show Gist options
  • Save dalcon10028/7ea0d6c83e422f5d40338e067d603e3c to your computer and use it in GitHub Desktop.
Save dalcon10028/7ea0d6c83e422f5d40338e067d603e3c to your computer and use it in GitHub Desktop.
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
sc.close();
int count=1; // 몇 번째 숫자인지 세는 변수
for(int i=666; ;i++){
String numToString = Integer.toString(i);
if (numToString.contains("666")) {
if (N==count++) {
System.out.println(i);
return;
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment