题解 | 无限长正整数排列字符串
无限长正整数排列字符串
https://www.nowcoder.com/practice/82c92d2321bb4220a3006d52a95a8bdd
import java.util.Scanner;
// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int n = in.nextInt();
String s= "";
StringBuffer sb = new StringBuffer();
for(int i = 0; i < 1000;i++){
sb.append(i);
}
System.out.print(sb.toString().charAt(n));
}
}

查看9道真题和解析