麻煩幫我看看if(sale>100&&year>2)為什么不行
#include?<stdio.h>
int?main()?
{
????int?sale=120;?//銷售業績為120萬
????int?year=1;?//剛剛進入公司1年
????//完善代碼
????if((sale>100)&&year>2)
????{
????????printf("%s\n","恭喜你獲獎了");
????}
????else
????{
????????printf("%s\n","很遺憾,期望你再接再厲");
????}
????
????
????
????
????
????
????
????
????
????
????
????
????return?0;
}
2020-02-16
#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","很遺憾,期望你再接再厲");//?; ????????} ????} ????else ????{ ????????printf("%s\n","很遺憾,期望你再接再厲");//?; ????} ????return?0; }2020-02-16
#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","很遺憾,期望你再接再厲");
??????? }
??? }
??? else
??? {
??????? printf("%s\n","很遺憾,期望你再接再厲");
??? }
??? return 0;
}
按參考代碼來也不行?
2020-02-16