下面的红色提示是哪里有错误吗

img


下面的提示是哪里有错误吗?也没有报错正常运行,初学者不是很懂啦

第12行改为String b=sr.next();看看

对对对,问题不大 参考: https://blog.csdn.net/weixin_45890113/article/details/126199142

img

import java.util.Scanner;

public class Practice {
    public static void main(String[] args) {
        Scanner sr = new Scanner(System.in);
        int a = sr.nextInt();
        Scanner sc = new Scanner(System.in);
        for (int i=0; i<=a; i++)
        {
            String b = sc.nextLine();
//            System.out.println(b.length());
            int n = 0;
            if((b.charAt(0) >= '0' && b.charAt(0) <= '9') &&b.charAt(0) != ' ')
                System.out.println("0");
            for (int j=0; j < b.length(); j++)
            {
                if((b.charAt(j) >= '0' && b.charAt(j) <= '9') || (b.charAt(j) >= 'a' && b.charAt(j) <= 'z') || (b.charAt(j) >= 'A' && b.charAt(j) <= 'Z'))
                    System.out.println("1");
                else
                    System.out.println("0");
            }
        }
    }
}