⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 student.java

📁 本代码是我从网上刚刚看的奥。我们期末考试就是这个设计
💻 JAVA
字号:
import java.util.*; 
public class student
{
     public static void main(String[] args)
     {
         GregorianCalendar d=new GregorianCalendar();
         int today=d.get(Calendar.DAY_OF_MONTH);
         int month=d.get(Calendar.MONTH);
         d.set(Calendar.DAY_OF_MONTH,1);
         int weekday=d.get(Calendar.DAY_OF_WEEK);
       
        
         System.out.println("sun mon tue wed thu fri sat");
         for(int i=Calendar.SUNDAY;i<weekday;i++)
         System.out.print("");
         do
         {
             int day=d.get(Calendar.DAY_OF_MONTH);
         if (day == 1&&weekday!=7)
         {
             for(int x =0;x<4*(weekday-1);x++) {
                 System.out.print(" ");
             }
         }
                                
             if(day<10 )   System.out.print(" ");
                            System.out.print(day);
             if(day==today)
             System.out.print("* ");
             else
             System.out.print("   ");
             if(weekday==Calendar.SATURDAY )
             System.out.println();
            
             d.add(Calendar.DAY_OF_MONTH,1);
             weekday=d.get(Calendar.DAY_OF_WEEK);
         }
         while(d.get(Calendar.MONTH)==month);
        
     }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -