zoukankan      html  css  js  c++  java
  • 我编辑的JAVA日历程序

    class calendar
     {
        public static void main(String[]args)
       {  
          int yearIn ;
          yearIn = Integer.parseInt(args[0]);
          showDays(yearIn);
        }
          static void showDays(int year) 
           {  int month = 1;
              out:
              for(;month<13;month++)
                   { switch(month)
                      {
                      case 1:
                      for(int day = 1;day<32;day++)
                          {System.out.println(month+"月"+day+"日");
                           } 
                      continue;
                      case 2:
                      int count =0;
                      if((year % 4)!=0)
                          {count = 28;}    
                      else if((year % 100==0)&(year % 400 != 0))
                          {count = 28;}
                      else 
                           {count = 29;}
                      for(int day=1;day<=count;day++)
                          {System.out.println(month+"月"+day+"日");
                           }
                       continue;
                      case 3:
                      for(int day = 1;day<32;day++)
                          {System.out.println(month+"月"+day+"日");
                           } 
                      continue;
                      case 4:
                      for(int day = 1;day<31;day++)
                          {System.out.println(month+"月"+day+"日");
                           } 
                      continue;
                       case 5:
                      for(int day = 1;day<32;day++)
                          {System.out.println(month+"月"+day+"日");
                           } 
                      continue;
                       case 6:
                      for(int day = 1;day<31;day++)
                          {System.out.println(month+"月"+day+"日");
                           } 
                      continue;
                      case 7:
                      for(int day = 1;day<32;day++)
                          {System.out.println(month+"月"+day+"日");
                           } 
                      continue;
                      case 8:
                      for(int day = 1;day<32;day++)
                          {System.out.println(month+"月"+day+"日");
                           } 
                      continue;
                      case 9:
                      for(int day = 1;day<31;day++)
                          {System.out.println(month+"月"+day+"日");
                           }
                      continue;
                      case 10:
                      for(int day = 1;day<32;day++)
                          {System.out.println(month+"月"+day+"日");
                           } 
                      continue;
                      case 11:
                      for(int day = 1;day<31;day++)
                          {System.out.println(month+"月"+day+"日");
                           } 
                      continue;
                      case 12:
                      for(int day = 1;day<32;day++)
                          {System.out.println(month+"月"+day+"日");
                           } 
                      continue;
                       }
                      }
    
    
    
             }
     
    
      }
    

      

  • 相关阅读:
    发送邮件以及数据导出
    GridView的使用(高度封装,不怎么灵活,repeat可替代)
    索引学习(一)
    JVM 学习笔记(二)
    JVM 学习笔记(一)
    JDBC 基础知识总结
    需要学习的点
    The Unified Modeling Language(UML)
    向往2的年代
    SQL 各种连接:内连接,外连接(左外,右外,完全外)
  • 原文地址:https://www.cnblogs.com/lubocsu/p/4903254.html
Copyright © 2011-2022 走看看