import?java.util.Scanner;
public?class?HelloWorld?{
????public?static?void?main(String[]?args)?{????????
????//創建String數組,并為每一個元素賦值。賦值內容為第幾周+學習內容????????
????String[]?contentList?=?new?String[35];????????
????contentList[0]?=?"【第1周】環境搭建與語法入門";????????
????contentList[1]?=?"【第2周】Java語法之循環、數組與方法";????????
????contentList[2]?=?"【第3周】面向對象之封裝與繼承";????????
????contentList[3]?=?"【第4周】面向對象之單例模式與多態";????????
????contentList[4]?=?"【第5周】常用工具類(上)";????????
????contentList[5]?=?"【第6周】常用工具類(下)";????????
????contentList[6]?=?"【第7周】常用工具類(下)";????????
????contentList[7]?=?"【第8周】前端基礎之HTML與CSS";????????
????contentList[8]?=?"【第9周】前端基礎之JavaScript與綜合案例";????????
????contentList[9]?=?"【第10周】Java?Web基礎";????????
????contentList[10]?=?"【第11周】Java?Web基礎";????????
????contentList[11]?=?"【第12周】常用功能與過濾器";????????
????contentList[12]?=?"【第13周】監聽器與項目實戰";????????
????contentList[13]?=?"【第14周】監聽器與項目實戰";????????
????contentList[14]?=?"【第15周】MySQL基礎";????????
????contentList[15]?=?"【第16周】MySQL基礎";????????
????contentList[16]?=?"【第17周】Java數據庫開發基礎";????????
????contentList[17]?=?"【第18周】框架前置知識";????????
????contentList[18]?=?"【第19周】MyBatis基礎";????????
????contentList[19]?=?"【第20周】MyBatis實現OA系統項目實戰";????????
????contentList[20]?=?"【第21周】MyBatis實現OA系統項目實戰";????????
????contentList[21]?=?"【第22周】Linux環境搭建與Redis應用";????????
????contentList[22]?=?"【第23周】Spring基礎";????????
????contentList[23]?=?"【第24周】Spring基礎";????????
????contentList[24]?=?"【第25周】Spring基礎";????????
????contentList[25]?=?"【第26周】SSM開發社交網站";????????
????contentList[26]?=?"【第27周】Spring?Boot電商項目實戰";????????
????contentList[27]?=?"【第28周】Spring?Boot電商項目實戰";????????
????contentList[28]?=?"【第29周】面試";????????
????contentList[29]?=?"【第30周】多線程與分布式";????????
????contentList[30]?=?"【第31周】多線程與分布式";????????
????contentList[31]?=?"【第32周】Spring?Cloud基礎";????????
????contentList[32]?=?"【第33周】Spring?Cloud電商實戰";????????
????contentList[33]?=?"【第34周】Spring?Cloud電商實戰";????????
????contentList[34]?=?"【第35周】Zookeeper+Dubbo應用與面試";????????
????//提示信息????????
????System.out.print("您要開始第幾周學習啦,直接輸入數字吧:");????????
????//設置變量存儲接收到的數據????????
????int?day?=?new?Scanner(System.in).nextInt();????????
????//計算今天是幾月(1-月第一周、4-月第4周)????????
????int?month?=?(int)Math.ceil(day*1.0?/?4);????????
????System.out.println("今天是"?+?month?+?"月");????????
????//計算輸入的周是這個月的第幾周????????
????int?week?=?day?%?4?==?0???4:?(day?%?4);????????
????System.out.println("今天是這個月的第"?+?week?+?"周");????????
????//提示信息????????
????System.out.println("以下是您本月的學習計劃,?√?代表當周學習任務");????????
????System.out.println("=======================================");????????????????
????//利用for循環,找到數組中對應這個月的內容輸出????????
????for?(int?i?=?(month?-?1)?*?4;?i?<?month?*?4?&&?i?<?contentList.length;?i++)?{????????????
????????//根據當前月第幾周,在輸出此行時,前面添加“√”????????????
????????if(day?==?i+1)?{????????????????
????????????System.out.println("√"?+?contentList[i]);????????????
????????????}?else?{????????????????
????????????System.out.println(contentList[i]);????????????
????????????}????????
?????}????????????????
??}
}
2022-09-08
2022-03-01
import?java.util.Scanner;public?class?HelloWorld?{????public?static?void?main(String[]?args)?{????????//創建String數組,并為每一個元素賦值。賦值內容為第幾周+學習內容????????String[]?contentList?=?new?String[35];????????contentList[0]?=?"【第1周】環境搭建與語法入門";????????contentList[1]?=?"【第2周】Java語法之循環、數組與方法";????????contentList[2]?=?"【第3周】面向對象之封裝與繼承";????????contentList[3]?=?"【第4周】面向對象之單例模式與多態";????????contentList[4]?=?"【第5周】常用工具類(上)";????????contentList[5]?=?"【第6周】常用工具類(下)";????????contentList[6]?=?"【第7周】常用工具類(下)";????????contentList[7]?=?"【第8周】前端基礎之HTML與CSS";????????contentList[8]?=?"【第9周】前端基礎之JavaScript與綜合案例";????????contentList[9]?=?"【第10周】Java?Web基礎";????????contentList[10]?=?"【第11周】Java?Web基礎";????????contentList[11]?=?"【第12周】常用功能與過濾器";????????contentList[12]?=?"【第13周】監聽器與項目實戰";????????contentList[13]?=?"【第14周】監聽器與項目實戰";????????contentList[14]?=?"【第15周】MySQL基礎";????????contentList[15]?=?"【第16周】MySQL基礎";????????contentList[16]?=?"【第17周】Java數據庫開發基礎";????????contentList[17]?=?"【第18周】框架前置知識";????????contentList[18]?=?"【第19周】MyBatis基礎";????????contentList[19]?=?"【第20周】MyBatis實現OA系統項目實戰";????????contentList[20]?=?"【第21周】MyBatis實現OA系統項目實戰";????????contentList[21]?=?"【第22周】Linux環境搭建與Redis應用";????????contentList[22]?=?"【第23周】Spring基礎";????????contentList[23]?=?"【第24周】Spring基礎";????????contentList[24]?=?"【第25周】Spring基礎";????????contentList[25]?=?"【第26周】SSM開發社交網站";????????contentList[26]?=?"【第27周】Spring?Boot電商項目實戰";????????contentList[27]?=?"【第28周】Spring?Boot電商項目實戰";????????contentList[28]?=?"【第29周】面試";????????contentList[29]?=?"【第30周】多線程與分布式";????????contentList[30]?=?"【第31周】多線程與分布式";????????contentList[31]?=?"【第32周】Spring?Cloud基礎";????????contentList[32]?=?"【第33周】Spring?Cloud電商實戰";????????contentList[33]?=?"【第34周】Spring?Cloud電商實戰";????????contentList[34]?=?"【第35周】Zookeeper+Dubbo應用與面試";????????//提示信息????????System.out.print("您要開始第幾周學習啦,直接輸入數字吧:");????????//設置變量存儲接收到的數據????????int?weekDay?=?new?Scanner(System.in).nextInt();????????int?month?=?0;????????if?(weekDay?%?4?==?0)?{????????????month?=?weekDay?/?4;????????}?else?{????????????month?=?weekDay?/?4?+?1;????????}????????System.out.println("以下是您本月的學習計劃,√代表當周學習任務");????????System.out.println("==================================");????????System.out.println("【*】當前月份=?"?+?month);????????//?(例如:4對應第一月第四周,5代表第二月第一周????????String[]?chinese?=?{"零",?"一",?"二",?"三",?"四",?"五",?"六",?"七",?"八",?"九"};????????int?weekDay1?=?0;????????if?(weekDay?>?4)?{????????????weekDay1?=?weekDay?-?(month?-?1)?*?4;????????????System.out.println(String.format("【*】%s對應第%s月第%s周",?weekDay,?chinese[month],?chinese[weekDay1]));????????}?else?{????????????System.out.println(String.format("【*】%s對應第%s月第%s周",?weekDay,?chinese[month],?chinese[weekDay]));????????}????????for?(int?i?=?(month?-?1)?*?4;?i?<?month?*?4;?i++)?{????????????try?{????????????????if?(i?==?weekDay?-?1)?{????????????????????//根據當前月第幾周,在輸出此行時,前面添加“√”????????????????????System.out.println("√"?+?contentList[i]);????????????????}?else?{????????????????????System.out.println(contentList[i]);????????????????}????????????}?catch?(Exception?e)?{????????????????System.out.println("【*】未發現第"?+?(i?+?1)?+?"周學習計劃");//????????????????e.printStackTrace();????????????}????????}????}}2021-07-16
import java.util.Scanner;
public class HelloWorld {
? ? public static void main(String[] args) {
? ? ? ? //創建String數組,并為每一個元素賦值。賦值內容為第幾周+學習內容
?省略數組部分。。。。。。。。。。。。。。。。。。。。
? ? ? ? //提示信息
? ? ? ? System.out.print("您要開始第幾周學習啦,直接輸入數字吧:");
? ? ? ? //設置變量存儲接收到的數據
? ? ? ? int week? = new Scanner(System.in).nextInt();
? ? ? ? //計算今天是幾月(1-月第一周、4-月第4周)
? ? ? ? int month = (week+3)/4;
? ? ? ? //計算輸入的周是這個月的第幾周
? ? ? ? int num = 4*(1-month)+week;
? ? ? ? //提示信息
? ? ? ? System.out.println("以下是您本月的學習計劃, √ 代表當周學習任務");
? ? ? ? System.out.println("=======================================");
? ? ? ??
? ? ? ? //利用for循環,找到數組中對應這個月的內容輸出
? ? ? ? for(int i=1; i<=4; i++){
? ? ? ? ? ? if((4*(month-1)+i-1) >= contentList.length){
? ? ? ? ? ? ? ? System.out.println((4*(month-1)+i)+"周無學習任務");????//考慮數組下標越界
? ? ? ? ? ? }
? ? ? ? ? ? else if(i == num && (week <= contentList.length)){
? ? ? ? ? ? ? ? //根據當前月第幾周,在輸出此行時,前面添加“√”
? ? ? ? ? ? ? ? System.out.println("* "+contentList[week-1]);????????????????//當前周week
? ? ? ? ? ? }
? ? ? ? ? ? else{
? ? ? ? ? ? ? ? System.out.println(contentList[4*(month-1)+i-1]);????????//本月其余周
? ? ? ? ? ? ? ??
? ? ? ? ? ? }
? ? ? ? }
? ? ? ? ? ??
? ? ? ? ? ??
? ? }
}
2021-06-05
大哥,你這個是不是少了個該月第幾周的代碼,還是我·沒看到呀
2021-05-01
如果是剛好是第四周呢
2021-04-14
終于看到個寫的簡單點的其他的都寫的好復雜
2021-03-23
都差不多吧
package?com.suzic; import?java.util.Scanner; public?class?Main?{ ????public?static?void?main(String[]?args)?{ ????????//創建String數組,并為每一個元素賦值。賦值內容為第幾周+學習內容 ????????String[]?contentList?=?new?String[35]; ????????contentList[0]?=?"【第1周】環境搭建與語法入門"; ????????contentList[1]?=?"【第2周】Java語法之循環、數組與方法"; ????????contentList[2]?=?"【第3周】面向對象之封裝與繼承"; ????????contentList[3]?=?"【第4周】面向對象之單例模式與多態"; ????????contentList[4]?=?"【第5周】常用工具類(上)"; ????????contentList[5]?=?"【第6周】常用工具類(下)"; ????????contentList[6]?=?"【第7周】常用工具類(下)"; ????????contentList[7]?=?"【第8周】前端基礎之HTML與CSS"; ????????contentList[8]?=?"【第9周】前端基礎之JavaScript與綜合案例"; ????????contentList[9]?=?"【第10周】Java?Web基礎"; ????????contentList[10]?=?"【第11周】Java?Web基礎"; ????????contentList[11]?=?"【第12周】常用功能與過濾器"; ????????contentList[12]?=?"【第13周】監聽器與項目實戰"; ????????contentList[13]?=?"【第14周】監聽器與項目實戰"; ????????contentList[14]?=?"【第15周】MySQL基礎"; ????????contentList[15]?=?"【第16周】MySQL基礎"; ????????contentList[16]?=?"【第17周】Java數據庫開發基礎"; ????????contentList[17]?=?"【第18周】框架前置知識"; ????????contentList[18]?=?"【第19周】MyBatis基礎"; ????????contentList[19]?=?"【第20周】MyBatis實現OA系統項目實戰"; ????????contentList[20]?=?"【第21周】MyBatis實現OA系統項目實戰"; ????????contentList[21]?=?"【第22周】Linux環境搭建與Redis應用"; ????????contentList[22]?=?"【第23周】Spring基礎"; ????????contentList[23]?=?"【第24周】Spring基礎"; ????????contentList[24]?=?"【第25周】Spring基礎"; ????????contentList[25]?=?"【第26周】SSM開發社交網站"; ????????contentList[26]?=?"【第27周】Spring?Boot電商項目實戰"; ????????contentList[27]?=?"【第28周】Spring?Boot電商項目實戰"; ????????contentList[28]?=?"【第29周】面試"; ????????contentList[29]?=?"【第30周】多線程與分布式"; ????????contentList[30]?=?"【第31周】多線程與分布式"; ????????contentList[31]?=?"【第32周】Spring?Cloud基礎"; ????????contentList[32]?=?"【第33周】Spring?Cloud電商實戰"; ????????contentList[33]?=?"【第34周】Spring?Cloud電商實戰"; ????????contentList[34]?=?"【第35周】Zookeeper+Dubbo應用與面試"; ????????//提示信息 ????????System.out.print("您要開始第幾周學習啦,直接輸入數字吧:"); ????????//設置變量存儲接收到的數據 ????????int?inputInt?=?new?Scanner(System.in).nextInt(); ????????//計算今天是幾月(1-月第一周、4-月第4周) ????????int?mounthInt?=?(int)?Math.ceil((double)inputInt?/?4); ????????System.out.print("今天是第"?+?mounthInt?+?"個月"); ????????//計算輸入的周是這個月的第幾周 ????????//提示信息 ????????System.out.println("以下是您本月的學習計劃,?√?代表當周學習任務"); ????????System.out.println("======================================="); ????????//利用for循環,找到數組中對應這個月的內容輸出 ????????for?(int?i?=?0;?i?<?contentList.length;?i++)?{ ????????????int?weekInt?=?i?+?1; ????????????if?((int)?Math.ceil((double)weekInt?/?4)?==?mounthInt)?{ ????????????????String?right?=?weekInt?==?inputInt???"√"?:?""; ????????????????System.out.println(right?+?contentList[i]); ????????????} ????????} ????} }2021-01-24
不需要膜拜我,畢竟我是哥哥。