//提示信息
System.out.print("您要開始第幾周學習啦,直接輸入數字吧:");
//設置變量存儲接收到的數據
double?input??=?new?Scanner(System.in).nextDouble();
//計算今天是幾月(1-月第一周、4-月第4周)
int?a?=?(int)Math.ceil((input/4));
System.out.println("今天是第"+a+"個月");
//計算輸入的周是這個月的第幾周
int?b?=?(int)Math.ceil(input)%4;
if?(b==0){
????System.out.println("今天是第四周");
}else
????System.out.println("今天是這個月的第"+b+"周");
//提示信息
System.out.println("以下是您本月的學習計劃,?√?代表當周學習任務");
System.out.println("=======================================");
//利用for循環,找到數組中對應這個月的內容輸出
for?(int?i?=?(int)?((a-1)*4);?i?<?a?*?4;?i++)?{
????//根據當前月第幾周,在輸出此行時,前面添加“√”
????if?(b==((i+1)%4)){
????????System.out.println("√"+contentList[i]);
????}else
????????System.out.println(contentList[i]);
}
2020-11-24
nice