LanQiaoTestCodes/字母数.java

31 lines
747 B
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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;
}
}