第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定

這個應(yīng)該是正確了,請大家參考斧正

public static void main(String[] args) {

//創(chuàng)建String數(shù)組,并為每一個元素賦值。賦值內(nèi)容為第幾周+學(xué)習(xí)內(nèi)容

? ? ? ? String[] contentList = new String[35];

? ? ? ? contentList[0] = "【第1周】環(huán)境搭建與語法入門";

? ? ? ? contentList[1] = "【第2周】Java語法之循環(huán)、數(shù)組與方法";

? ? ? ? contentList[2] = "【第3周】面向?qū)ο笾庋b與繼承";

? ? ? ? contentList[3] = "【第4周】面向?qū)ο笾畣卫J脚c多態(tài)";

? ? ? ? contentList[4] = "【第5周】常用工具類(上)";

? ? ? ? contentList[5] = "【第6周】常用工具類(下)";

? ? ? ? contentList[6] = "【第7周】常用工具類(下)";

? ? ? ? contentList[7] = "【第8周】前端基礎(chǔ)之HTML與CSS";

? ? ? ? contentList[8] = "【第9周】前端基礎(chǔ)之JavaScript與綜合案例";

? ? ? ? contentList[9] = "【第10周】Java Web基礎(chǔ)";

? ? ? ? contentList[10] = "【第11周】Java Web基礎(chǔ)";

? ? ? ? contentList[11] = "【第12周】常用功能與過濾器";

? ? ? ? contentList[12] = "【第13周】監(jiān)聽器與項目實戰(zhàn)";

? ? ? ? contentList[13] = "【第14周】監(jiān)聽器與項目實戰(zhàn)";

? ? ? ? contentList[14] = "【第15周】MySQL基礎(chǔ)";

? ? ? ? contentList[15] = "【第16周】MySQL基礎(chǔ)";

? ? ? ? contentList[16] = "【第17周】Java數(shù)據(jù)庫開發(fā)基礎(chǔ)";

? ? ? ? contentList[17] = "【第18周】框架前置知識";

? ? ? ? contentList[18] = "【第19周】MyBatis基礎(chǔ)";

? ? ? ? contentList[19] = "【第20周】MyBatis實現(xiàn)OA系統(tǒng)項目實戰(zhàn)";

? ? ? ? contentList[20] = "【第21周】MyBatis實現(xiàn)OA系統(tǒng)項目實戰(zhàn)";

? ? ? ? contentList[21] = "【第22周】Linux環(huán)境搭建與Redis應(yīng)用";

? ? ? ? contentList[22] = "【第23周】Spring基礎(chǔ)";

? ? ? ? contentList[23] = "【第24周】Spring基礎(chǔ)";

? ? ? ? contentList[24] = "【第25周】Spring基礎(chǔ)";

? ? ? ? contentList[25] = "【第26周】SSM開發(fā)社交網(wǎng)站";

? ? ? ? contentList[26] = "【第27周】Spring Boot電商項目實戰(zhàn)";

? ? ? ? contentList[27] = "【第28周】Spring Boot電商項目實戰(zhàn)";

? ? ? ? contentList[28] = "【第29周】面試";

? ? ? ? contentList[29] = "【第30周】多線程與分布式";

? ? ? ? contentList[30] = "【第31周】多線程與分布式";

? ? ? ? contentList[31] = "【第32周】Spring Cloud基礎(chǔ)";

? ? ? ? contentList[32] = "【第33周】Spring Cloud電商實戰(zhàn)";

? ? ? ? contentList[33] = "【第34周】Spring Cloud電商實戰(zhàn)";

? ? ? ? contentList[34] = "【第35周】Zookeeper+Dubbo應(yīng)用與面試";


? ? ? ? //提示信息

? ? ? ? System.out.print("您要開始第幾周學(xué)習(xí)啦,直接輸入數(shù)字吧:");

? ? ? ? //設(shè)置變量存儲接收到的數(shù)據(jù)

? ? ? ? int week? = new Scanner(System.in).nextInt();


? ? ? ? //計算今天是幾月(1-月第一周、4-月第4周)

? ? ? ? int moon = 1 + week / 4 ;

? ? ? ? System.out.println("今天是" + moon + "月");

? ? ? ? //計算輸入的周是這個月的第幾周

? ? ? ? int moon_week = week % 4 ;

? ? ? ? System.out.println("這周是這個月的第" + moon_week + "周");

? ? ? ? //提示信息

? ? ? ? System.out.println("以下是您本月的學(xué)習(xí)計劃, √ 代表當(dāng)周學(xué)習(xí)任務(wù)");

? ? ? ? System.out.println("=======================================");

? ? ? ??

? ? ? ? //利用for循環(huán),找到數(shù)組中對應(yīng)這個月的內(nèi)容輸出

? ? ? ? for ( int i = 0 ; i <= contentList.length; i++ ){

? ? ? ? ? ? if( i / 4 == moon - 1 ){

? ? ? ? ? ? ? ? //根據(jù)當(dāng)前月第幾周,在輸出此行時,前面添加“√”? ? ? ? ? ? ? ??

? ? ? ? ? ? if( i + 1 == week ){

? ? ? ? ? ? ? ? ? ? System.out.println( "√" + contentList[ i ] );

? ? ? ? ? ? ? ? }else {

? ? ? ? ? ? ? ? System.out.println( contentList[ i ] );

? ? ? ? ? ? ? ? }

? ? ? ? ? ? }

? ? ? ? ? ??

? ? ? ? }

? ? ? ? ? ??

}


}


正在回答

3 回答

System.out.print("您要開始第幾周學(xué)習(xí)啦,直接輸入數(shù)字吧:");
//設(shè)置變量存儲接收到的數(shù)據(jù)
int??week?=?new?Scanner(System.in).nextInt();

//計算今天是幾月

int?mooth?=?(week-1)/4?+?1;


這是我的計算今天是幾月的代碼,沒有用條件判斷,請大家看看有沒有什么問題。

關(guān)于計算本周是第幾月的第幾周的問題有人知道嗎?


0 回復(fù) 有任何疑惑可以回復(fù)我~

朋友,你這個月份輸入的有問題吧。假如輸入的是4的話,按你的程序第四周是第二個月的,顯然不正確

應(yīng)該再增加個判斷語句吧0.0

0 回復(fù) 有任何疑惑可以回復(fù)我~

import java.util.Scanner;


public class HelloWorld {

? ? public static void main(String[] args) {

? ? ? ? //創(chuàng)建String數(shù)組,并為每一個元素賦值。賦值內(nèi)容為第幾周+學(xué)習(xí)內(nèi)容

? ? ? ? String[] contentList = new String[35];

? ? ? ? contentList[0] = "【第1周】環(huán)境搭建與語法入門";

? ? ? ? contentList[1] = "【第2周】Java語法之循環(huán)、數(shù)組與方法";

? ? ? ? contentList[2] = "【第3周】面向?qū)ο笾庋b與繼承";

? ? ? ? contentList[3] = "【第4周】面向?qū)ο笾畣卫J脚c多態(tài)";

? ? ? ? contentList[4] = "【第5周】常用工具類(上)";

? ? ? ? contentList[5] = "【第6周】常用工具類(下)";

? ? ? ? contentList[6] = "【第7周】常用工具類(下)";

? ? ? ? contentList[7] = "【第8周】前端基礎(chǔ)之HTML與CSS";

? ? ? ? contentList[8] = "【第9周】前端基礎(chǔ)之JavaScript與綜合案例";

? ? ? ? contentList[9] = "【第10周】Java Web基礎(chǔ)";

? ? ? ? contentList[10] = "【第11周】Java Web基礎(chǔ)";

? ? ? ? contentList[11] = "【第12周】常用功能與過濾器";

? ? ? ? contentList[12] = "【第13周】監(jiān)聽器與項目實戰(zhàn)";

? ? ? ? contentList[13] = "【第14周】監(jiān)聽器與項目實戰(zhàn)";

? ? ? ? contentList[14] = "【第15周】MySQL基礎(chǔ)";

? ? ? ? contentList[15] = "【第16周】MySQL基礎(chǔ)";

? ? ? ? contentList[16] = "【第17周】Java數(shù)據(jù)庫開發(fā)基礎(chǔ)";

? ? ? ? contentList[17] = "【第18周】框架前置知識";

? ? ? ? contentList[18] = "【第19周】MyBatis基礎(chǔ)";

? ? ? ? contentList[19] = "【第20周】MyBatis實現(xiàn)OA系統(tǒng)項目實戰(zhàn)";

? ? ? ? contentList[20] = "【第21周】MyBatis實現(xiàn)OA系統(tǒng)項目實戰(zhàn)";

? ? ? ? contentList[21] = "【第22周】Linux環(huán)境搭建與Redis應(yīng)用";

? ? ? ? contentList[22] = "【第23周】Spring基礎(chǔ)";

? ? ? ? contentList[23] = "【第24周】Spring基礎(chǔ)";

? ? ? ? contentList[24] = "【第25周】Spring基礎(chǔ)";

? ? ? ? contentList[25] = "【第26周】SSM開發(fā)社交網(wǎng)站";

? ? ? ? contentList[26] = "【第27周】Spring Boot電商項目實戰(zhàn)";

? ? ? ? contentList[27] = "【第28周】Spring Boot電商項目實戰(zhàn)";

? ? ? ? contentList[28] = "【第29周】面試";

? ? ? ? contentList[29] = "【第30周】多線程與分布式";

? ? ? ? contentList[30] = "【第31周】多線程與分布式";

? ? ? ? contentList[31] = "【第32周】Spring Cloud基礎(chǔ)";

? ? ? ? contentList[32] = "【第33周】Spring Cloud電商實戰(zhàn)";

? ? ? ? contentList[33] = "【第34周】Spring Cloud電商實戰(zhàn)";

? ? ? ? contentList[34] = "【第35周】Zookeeper+Dubbo應(yīng)用與面試";


? ? ? ? //提示信息

? ? ? ? System.out.print("您要開始第幾周學(xué)習(xí)啦,直接輸入數(shù)字吧:");

? ? ? ? //設(shè)置變量存儲接收到的數(shù)據(jù)

? ? ? ? int week = new Scanner(System.in).nextInt();


? ? ? ? //計算今天是幾月(1-月第一周、4-月第4周)

? ? ? ? int curmonth = week / 4;

? ? ? ??

? ? ? ? //計算輸入的周是這個月的第幾周

? ? ? ? int curweek = week % 4;

? ? ? ??

? ? ? ? //提示信息

? ? ? ? System.out.println("以下是您本月的學(xué)習(xí)計劃, √ 代表當(dāng)周學(xué)習(xí)任務(wù)");

? ? ? ? System.out.println("=======================================");

? ? ? ??

? ? ? ? //利用for循環(huán),找到數(shù)組中對應(yīng)這個月的內(nèi)容輸出

? ? ? ? for(int i = (curmonth-1) * 4; i < curmonth * 4; i++){

? ? ? ? ? ? //根據(jù)當(dāng)前月第幾周,在輸出此行時,前面添加“√”

? ? ? ? ? ? if (i == week-1) {

? ? ? ? ? ? ? ? System.out.println("√ " + contentList[i]);

? ? ? ? ? ? }else {

? ? ? ? ? ? ? ? System.out.println(contentList[i]);

? ? ? ? ? ? }

? ? ? ? }

? ? }

}


0 回復(fù) 有任何疑惑可以回復(fù)我~
#1

應(yīng)該怎么愛

你這個計算月份的是錯誤的吧,如果輸入1的話就會顯示第0月,因為int類型會把小數(shù)位后的值去掉,輸入9的話會顯示第二月
2021-08-04 回復(fù) 有任何疑惑可以回復(fù)我~

舉報

0/150
提交
取消
Java入門第一季(IDEA工具)升級版
  • 參與學(xué)習(xí)       1167319    人
  • 解答問題       18530    個

0基礎(chǔ)萌新入門第一課,從Java環(huán)境搭建、工具使用、基礎(chǔ)語法開始

進入課程

這個應(yīng)該是正確了,請大家參考斧正

我要回答 關(guān)注問題
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號