用JAVA编写闰年出错

来源:百度知道 编辑:UC知道 时间:2024/07/02 14:21:55
import java.io.*;
public class woshishui{
public static void main(String arge[])throws IOException{
InputStreamReader ir ;
BufferedReader in;
ir=new InputStreamReader(System.in);
in=new BufferedReader(ir);
System.out.println("请输入年份");
String s=in.readLine();
int year=Integer.parselnt(s);
if (year%4==0 && year%100!=0 || year %400==0)
{
System.out.println(""+year+"年是闰年");
}
else
{
System.out.println(""+year+"年不是闰年");
}
}
}
出现错误:在int year=Integer.parselnt(s);找不到符号。
谁给我解决一下。

int year=Integer.parselnt(s);

要改成

int year=Integer.parseInt(s); // I你写成l了

对的啊

是parseInt(s),那个是'i'的大写,不是'L'的小写。