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

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

default的作用是什么,break為什么不能加在printf前面

#include?<stdio.h>int?main()?{?????/*?定義需要計(jì)算的日期?*/????int?year?=?2008;????int?month?=?8;????int?day?=?8;????/*?????*?請(qǐng)使用switch語句,if...else語句完成本題?????*?如有想看小編思路的,可以點(diǎn)擊左側(cè)任務(wù)中的“不會(huì)了怎么辦”?????*?小編還是希望大家獨(dú)立完成哦~?????*/????int?date?=?0;????????month?-=?1;????????switch(month)????????{????????????case?8:????????????????date?+=?31;????????????case?7:????????????????date?+=?31;?????????????????????????????case?6:????????????????date?+=?30;?????????????????????????????case?5:????????????????date?+=?31;???????????????????????????case?4:????????????????date?+=?30;????????????case?3:????????????????date?+=?31;?????????????case?2:????????????????if((year%4?==?0?&&?year%400?!=?0)?||?year%400?==?0)??????????????????????{?????????????????????????date?+=?29;??????????????????????}????????????????else????????????????????{????????????????????????date?+=?28;????????????????????}????????????case?1:????????????????date?+=?31;????????????????????????default:????????????date?=?date?+?day;???????????????????????printf("2008年8月8日是該年的第%d天",date);?????????????break;????????}	return?0;}


正在回答

2 回答

#include <stdio.h>

int main()?

{?

? ? /* 定義需要計(jì)算的日期 */

? ? int year = 2008;

? ? int month = 8;

? ? int day = 8;

? ? /*

? ? ?* 請(qǐng)使用switch語句,if...else語句完成本題

? ? ?* 如有想看小編思路的,可以點(diǎn)擊左側(cè)任務(wù)中的“不會(huì)了怎么辦”

? ? ?* 小編還是希望大家獨(dú)立完成哦~

? ? ?*/

? ? int date = 0;

? ? ? ? month -= 1;

? ? ? ? switch(month)

? ? ? ? {

? ? ? ? ? ? case 8:

? ? ? ? ? ? ? ? date += 31;

? ? ? ? ? ? case 7:

? ? ? ? ? ? ? ? date += 31;

? ? ? ? ? ? ? ? ?

? ? ? ? ? ? case 6:

? ? ? ? ? ? ? ? date += 30;

? ? ? ? ? ? ? ? ?

? ? ? ? ? ? case 5:

? ? ? ? ? ? ? ? date += 31;

? ? ? ? ? ? ? ?

? ? ? ? ? ? case 4:

? ? ? ? ? ? ? ? date += 30;

? ? ? ? ? ? case 3:

? ? ? ? ? ? ? ? date += 31;

? ? ? ? ? ? ?case 2:

? ? ? ? ? ? ? ? if((year%4 == 0 && year%400 != 0) || year%400 == 0)?

? ? ? ? ? ? ? ? ? ? ?{

? ? ? ? ? ? ? ? ? ? ? ? ?date += 29;?

? ? ? ? ? ? ? ? ? ? ?}

? ? ? ? ? ? ? ? else

? ? ? ? ? ? ? ? ? ? {

? ? ? ? ? ? ? ? ? ? ? ? date += 28;

? ? ? ? ? ? ? ? ? ? }

? ? ? ? ? ? case 1:

? ? ? ? ? ? ? ? date += 31;

? ? ? ? ? ??

? ? ? ? ? ? default:

? ? ? ? ? ? date = date + day;

? ? ? ? ? ?

? ? ? ? ? ? printf("2008年8月8日是該年的第%d天",date);

? ? ? ? ? ? ?break;

? ? ? ? }


return 0;

}


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

剛剛把break去掉程序仍然正確,為什么呢

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

舉報(bào)

0/150
提交
取消

default的作用是什么,break為什么不能加在printf前面

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

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

幫助反饋 APP下載

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

公眾號(hào)

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