31 lines
747 B
Java
31 lines
747 B
Java
package LanQiaoOJ;
|
||
/*
|
||
* 问题描述
|
||
请找到一个大于2022的最小数,这个数转换成十六进制之
|
||
后,所有的数位(不含前导0)都为字母(A到F)。
|
||
请将这个数的十进制形式作为答案提交。*/
|
||
public class 字母数 {
|
||
public static void main(String[] args) {
|
||
//在此输入您的代码...
|
||
for(int i=2022;true;i++){
|
||
if(check(i)){
|
||
System.out.print(i);
|
||
break;
|
||
}
|
||
}
|
||
}
|
||
static boolean check(int i){
|
||
while(i/16>0){
|
||
if(i%16>=10&&i%16<=15){
|
||
i/=16;
|
||
}else{
|
||
return false;
|
||
}
|
||
}
|
||
if(i>=10&&i<=15) {
|
||
return true;
|
||
}
|
||
return false;
|
||
}
|
||
}
|