自己的ide上面可以
但是力扣过不了 不知道为啥
import java.util.Scanner;
public class test {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
sc.nextLine();
while(n -- > 0){
char[] cs = sc.nextLine().toCharArray();
if(cs[0] < 'A' || cs[0] >'Z' || (cs[0] > 'z' && cs[0] < 'a')){
System.out.println("Wrong");
continue;
}
boolean flag = true;
boolean hasnum = false;
for(int i = 1; i < cs.length; i ++){
if (cs[i] < '0' || (cs[i] > '9' && cs[i] < 'A') || (cs[i] > 'Z' && cs[i] < 'a') || cs[i] > 'z'){
flag = false;
break;
}else if(!hasnum && cs[i] >= '0' && cs[i] <= '9'){
hasnum = true;
}
}
System.out.println((flag && hasnum) ? "Accept" : "Wrong");
}
}
}