博客
关于我
【计算机二级Java语言】卷013
阅读量:466 次
发布时间:2019-03-06

本文共 521 字,大约阅读时间需要 1 分钟。

为了使Java_1.java程序能够判断输入的年份是否为闰年,我们需要在注释行"//Found"下一行语句的下划线处填入正确的代码。正确的代码如下:

public void ________(Graphics g) {    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));    System.out.println("请输入年份:");    String input = br.readLine();    int year = Integer.parseInt(input);    if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {        System.out.println("是闰年!");    } else {        System.out.println("不是闰年!");    }}

注:请将上述代码插入到下划线处,并删除下划线本身。请勿删除注释行或改动其他已有语句内容。存盘时文件必须存放在考生文件夹下,不得改变原有文件的文件名。

转载地址:http://pthyz.baihongyu.com/

你可能感兴趣的文章
python | fire,一个强大的 Python 库!
查看>>
python | flanker,一个神奇的 Python 库!
查看>>
python | flower,一个强大的 Python 库!
查看>>
python | funcy,一个超强的 提供函数式编程工具 Python 库!
查看>>
python | ggplot,一个超强的 Python 库!
查看>>
python | grab,一个强大的 Python 库!
查看>>
python | gunicorn,一个非常实用的 Python 库!
查看>>
python | h5py,一个无敌的关于 HDF5 的 Python 库!
查看>>
python | huey,一个非常厉害的 任务调度 Python 库!
查看>>
python | hypothesis,一个有趣的 Python 库!
查看>>
python | Indico,一个超酷的 Python 库!
查看>>
python | isort,一个有趣的 自动整理导入语句 的Python 库!
查看>>
python | jinja,一个超酷的 Python 库!
查看>>
python | joblib,一个强大的 Python 库!
查看>>
python调用git bash_Python学习第70课-用Git Bash在命令行打开sublime
查看>>
python | jsonschema,一个实用的 验证 JSON 数据结构 Python 库!
查看>>
python课程的中期报告范文_课题研究中期总结报告范文
查看>>
python | lxml,一个超酷的 关于XML/HTML 文档 Python 库!
查看>>
python | mplfinance,一个有趣的金融数据可视化 Python 库!
查看>>
python | nipy,一个强大的关于 神经影像数据分析 的Python 库!
查看>>