大佬幫我看看哪里錯了呀
#include <stdio.h>
int main()
{
??? int sale=120; //銷售業績為120萬
??? int year=1; //剛剛進入公司1年
??? //完善代碼
??? if(sale > 100)
??? {
??????? if(year >= 2)
??????? {
??????????? printf("%s\n","有資格獲得優秀員工獎");
??????? }
??????? printf("%s\n","很遺憾,期望你再接再厲");
??? }
??? esle
??? {
??????? printf("%s\n","很遺憾,期望你再接再厲");
??? }
??? return 0;
}
2018-12-16
第二個if的}后缺少else
你的else打錯了,是else 不是esle
2018-12-13
#include <stdio.h>
int main()?
{
??? int sale=120; //銷售業績為120萬
??? int year=1; //剛剛進入公司1年
??? //完善代碼
??? if(sale > 100)
??? {
??????? if(year >= 2)
??????? {
??????????? printf("%s\n","有資格獲得優秀員工獎");
??????? }else{
??????? printf("%s\n","很遺憾,期望你再接再厲");
????}
??? }
??? esle
??? {
??????? printf("%s\n","很遺憾,期望你再接再厲");
??? }
??? return 0;
}
在第二個if里面少了一個else ,所以是語法錯誤
2018-12-12
#include <stdio.h>
int main()
{
??? int sale=120; //銷售業績為120萬
??? int year=1; //剛剛進入公司1年
??? //完善代碼
??? if(sale > 100)
??? {
??????? if(year >= 2)
??????? {
??????????? printf("%s\n","有資格獲得優秀員工獎");
??????? }
????????else
????????{
??????? ????printf("%s\n","很遺憾,期望你再接再厲");
????????}
? ? }
??? esle
??? {
??????? printf("%s\n","很遺憾,期望你再接再厲");
??? }
??? return 0;
}
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?