請問這個代碼哪兒錯了
#include <stdio.h>
int main()
{
??? int sale=120; //銷售業(yè)績?yōu)?20萬
??? int year=1; //剛剛進(jìn)入公司1年
??? //完善代碼
??? if(sale > 100)
??? {
??????? if(year >= 2)
??????? {
??????????? printf("%s\n","恭喜獲獎");
??????? }
??? }
??? else
??? {
??????? printf("%s\n","很遺憾,期望你再接再厲");
??? }
?? ?
?? ?
???? ?
??? return 0;
}
求教
2015-12-31
else應(yīng)該在第一個if里面 像這樣
#include <stdio.h>
int main()?
{
? ? int sale=120; //銷售業(yè)績?yōu)?20萬
? ? int year=1; //剛剛進(jìn)入公司1年
? ? //完善代碼
? ? if(sale > 100)
? ? {
? ? ? ? if(year >= 2)
? ? ? ? {
? ? ? ? ? ? printf("%s\n","恭喜獲獎");
? ? ? ? }
? ??
? ? else
? ? {
? ? ? ? printf("%s\n","很遺憾,期望你再接再厲");
? ? }
? ? }?
? ??
? ? ??
? ? return 0;
}