第06章:Java程序的流程控制.pptVIP

  • 5
  • 0
  • 约1.32万字
  • 约 25页
  • 2018-05-02 发布于湖北
  • 举报
第06章:Java程序的流程控制

谢谢! * * * * * * public class HomeWork1 { public static void main(String[] args) { Scanner scan = new Scanner(System.in); System.out.println(“请输入年份:); int year = scan.nextInt(); if((year%4==0 year%100!=0) || year%400==0){ System.out.println(year+是闰年!); }else{ System.out.println(year+是平年!); } } } public class HomeWork2 { public static void main(String[] args) { int result = 0; for(int i=1;i100;i+=2){ result+=i; } System.out.println(1+3+5+7+……+99=+result); } } public class HomeWork3 { public static void main(String[] args) { System.out.println(***** fo

文档评论(0)

1亿VIP精品文档

相关文档