天天看點

idea中 java: 找不到符号 符号: 變量 i

idea中 java: 找不到符号 符号: 變量 i

import java.util.Scanner;

public class PalindromucNumber {
    public static void main(String[] args) {
        Scanner in= new Scanner(System.in);
        int PN=in.nextInt();
        int []N;
        N=new int[5];//N分别代表12345位
        for (int i=0; i<N.length;i++);{

            N[i]=PN%10;
            PN=PN/10;
        }
        if (N[0]==N[4]&&N[1]==N[3]){
            System.out.println("是回文數");
        }
        else {
            System.out.println("不是回文數");
        }
    }
}

           
原因:for循環條件後面多了“;”