第6周作业
来源:互联网 发布:菠萝饭官方软件 编辑:程序博客网 时间:2024/04/30 19:57
//1-闰年之循环判断
package ww;//闰年程序public class LeapYearFor2 {static boolean isLeapYear(int year){if((year%4==0&&year%100!=0)||year%400==0)return true;elsereturn false;}public static void main(String args[]){int count=0;for(int i=1800;i<=2014;i++){if(isLeapYear(i)){System.out.print(" "+i);count++;}if(count%25==0)System.out.println();}}}运行结果如下
1804 1808 1812 1816 1820 1824 1828 1832 1836 1840 1844 1848 1852 1856 1860 1864 1868 1872 1876 1880 1884 1888 1892 1896 1904 1908 1912 1916 1920 1924 1928 1932 1936 1940 1944 1948 1952 1956 1960 1964 1968 1972 1976 1980 1984 1988 1992 1996 2000 2004 2008 2012
//2-IF语句大显身手之成绩判断
import javax.swing.JOptionPane;public class GradeIf2 {public static void main(String args[]){double grade = 0.0;double score = 0;String input = JOptionPane.showInputDialog("Enter the grade of a TouchType: ");score=new Integer(input);System.out.println(score );if(score<60)JOptionPane.showMessageDialog(null, "D级");elseif(score<70)JOptionPane.showMessageDialog(null, "C级");elseif(score<85)JOptionPane.showMessageDialog(null, "B级");elseJOptionPane.showMessageDialog(null, "A级");}}
0 0
- 第6周作业
- 第6周作业
- 第6周作业
- 第6周作业1
- RFID第6周作业
- 第6周RFID作业
- 第6周作业-图像缩放显示
- 第6周作业-图像缩放显示
- 第6周作业--图像缩放显示
- 第6周作业-图像缩放显示
- 第6周作业-图像缩放显示
- 第6周作业-图像缩放显示
- 第6周作业-图像缩放显示
- 第6周作业-图像缩放显示
- 第6周作业-图像缩放显示
- 第6周作业3-Fibonacci数列
- 第6周作业3-Fibonacci数列
- 第6周作业-图像缩放显示
- Subresource for target class has no jax-rs annotations
- NSStringg常用用法
- C语言~和>>运算符
- 段位结构体与补码、大小端
- 明星粉丝经济“叫好不叫座”?变现需找准“窍门儿”
- 第6周作业
- Ubuntu, Red Hat设置开机进入shell界面
- BGP 学习第一课
- 初识设计模式 chapter 08-模板方法模式
- DataGridView控件使用大全
- 数据结构与算法[LeetCode]—Container With Most Water
- 字符集之NLS_LANG
- 白话详解JavaScript原型
- list双向链表容器