以下哪一年不是闰年?A.1600年B.1800年C.1964年
以下哪一年不是闰年?
A.1600年
B.1800年
C.1964年
以下哪一年不是闰年?
A.1600年
B.1800年
C.1964年
请在每条横线处填写一个语句,使程序的功能为:判断输入的年份是否为闰年(例如:1998年不是闰年,2000年是闰年).
注意:请勿改动main()主方法和其他已有的语句内容,仅在横线处填入适当的语句。
import java.io.*;
public class LeapYear{
public static void main(String args[]){
___________________;
BufferedReader in;
ir=new InputStreamReader(_____________________________);
in=new BufferedReader(ir);
System. out. print In("输入年份是: ");
String s=in.readline();
int year=___________________
if(year%4==0&&year%100!=0||year%400==0
System.out.println(" "+year+" "年是闰年. ");
else
System.out.println(" " +year+ " "年不是闰年.");
}
}
}
A.101
B.102
C.103
D.104
A.104
B.105
C.103
D.106
下列程序的功能是判断某一年是否为闰年。请在横线处填入适当内容,使程序能够正确运行。
import java.io.*;
public class LeapYear{
public static void main(String arge[])throws IOExceptionl
InputStreamReader ir;
BufferdeReadwe in;
ir=new InputStreamReader(System.in ;
in=new BufferedReader(ir);
System. out.println("输入年份是: ");
String s=______
int year=Integer.parseInt (s) ;
if(year%4==0&&year%100!=0//year%400==0)
{
System.out.println(""+year+"年是闰年.");
}
else
{
System. out.println (""+year+"年不是闰年.. ") ;
}
}
为了保护您的账号安全,请在“简答题”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!