為什么顯示運(yùn)行成功輸出錯(cuò)誤
using System;
using System.Collections.Generic;
using System.Text;
namespace Test
{
??? class Program
??? {
??????? static void Main(string[] args)
??????? {
??????????? double money = 60000.00;//存款金額
??????????? if (money>=100000)
??????????? {
??????????????? if (money<100000&&money>=50000)
??????????????? {
??????????????????? if(money<50000&&money>10000)
??????????????????? {
??????????????????????? Console.WriteLine(" 送一袋大米");
??????????????????? }
??????????????????? else
??????????????????? {
??????????????????????? Console.WriteLine("沒有禮品");
??????????????????? }
???????????????
??????????????????? Console.WriteLine("送一套茶具");
??????????????? }
???????????
??????????????? Console.WriteLine("送一臺(tái)微波爐");
??????????? }//請(qǐng)?jiān)谶@里補(bǔ)充多重條件判斷
??????? }
??? }
}
2018-08-09
數(shù)值為60000,您的第一個(gè)條件語句是滿足大于100000才進(jìn)入大括號(hào)內(nèi)語句,但并不滿足,所以直接跳出。建議縷清思路再進(jìn)行編程。
2022-03-24
這樣寫還是有一點(diǎn)好處的,雖然不是很明顯:如果nospace返回false,那么就不必做nomove的4個(gè)判斷了,能節(jié)約一點(diǎn)效率,雖然這幾乎是微乎其微的請(qǐng)問有素材圖片嗎
2018-08-30
直接使用 if ? elseif ?else ?你那看的頭暈