• 我编辑的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;
                       }
                      }
    
    
    
             }
     
    
      }
    

      

  • 相关阅读:
    burpsuite 不能抓取其他虚拟机环回地址
    Widows搭建sqli-labs
    Mysql内置函数
    MySQL用户创建于授权
    SQL注入
    XSS/CSRF/SSRF/XXE
    Cookie与Session的区别
    HACKTHEBOX邀请码
    kali安装jdk
    java -D
  • 原文地址:https://www.cnblogs.com/lubocsu/p/4903254.html
Copyright © 2020-2023  润新知