大佬教我一下
#include <stdio.h>
int main()?
{
? ? int sale=120; //銷(xiāo)售業(yè)績(jī)?yōu)?20萬(wàn)
? ? int year=1; //剛剛進(jìn)入公司1年
? ? //完善代碼
? ? if(sale >= 100)
? ? {
? ? ? ? if(year >= 2)
? ? ? ? {
? ? ? ? printf("%s\n","優(yōu)秀員工獎(jiǎng)");
? ? ? ? }
? ? }
? ? else
? ? {
? ? ? ? printf("%s\n","很遺憾,期望你再接再厲");
? ? }
? ? return 0;
}
2021-10-15
你判斷年份的 if 語(yǔ)句少了 else 的部分撒
銷(xiāo)售值 120 是大于 100 的,所以它不會(huì)去執(zhí)行外層 else 語(yǔ)句的代碼塊的,再加上你里面又沒(méi)有 else 語(yǔ)句,所以才會(huì)導(dǎo)致沒(méi)有輸出