這到底哪里有錯,找不出來
using System;
using System.Collections.Generic;
using System.Text;
namespace Test
{
? ? class Program
? ? {
? ? ? ? static void Main(string[] args)
? ? ? ? {
? ? ? ? ? ? double money = 60000.00;//存款金額
? ? ? ? ? ? if(money>=10000)
? ? ? ? ? ? {
? ? ? ? ? ? ? ?if(money>=50000)
? ? ? ? ? ? ? ?{
? ? ? ? ? ? ? ? ? ?if(money>=100000)
? ? ? ? ? ? ? ? ? ?{
? ? ? ? ? ? ? ? ? ? ? ?Console.WriteLine("送一臺微波爐");
? ? ? ? ? ? ? ? ? ?}else{
? ? ? ? ? ? ? ? ? ? ? ?Console.WriteLine("送一套茶具");
? ? ? ? ? ? ? ? ? ?}
? ? ? ? ? ? ? ?}else{
? ? ? ? ? ? ? ? ? ?Console.WriteLine("送一袋大米");
? ? ? ? ? ? }else {
? ? ? ? ? ? ? ? Console.WriteLine("沒有禮品");
? ? ? ? ? ? }//請在這里補充多重條件判斷
? ? ? ? }
? ? }
}
2023-05-10
//我這樣子不容易出錯 static?void?Main(string[]?args) ????????{ ????????????double?money?=?60000.00;//存款金額 ????????????if?(money?>?100000)//請在這里補充多重條件判斷 ????????????????Console.WriteLine("送一臺微波爐"); ????????????else?if?(money?>?50000) ????????????????Console.WriteLine("送一套茶具"); ????????????else?if?(money?>?10000) ????????????????Console.WriteLine("送一袋大米"); ????????????else ????????????????Console.WriteLine("沒有禮品"); ????????}2022-10-26
你可以對照一下,50000那個符號應該是英文模式下的,你寫成中文的了,另外就是把
else {
? ? ? ? ? ? ? ? Console.WriteLine("沒有禮品");
? ? ? ? ? ? }//請在這里補充多重條件判斷
放到倒數第三個 } 后再加個 }
2022-10-26
using System;
using System.Collections.Generic;
using System.Text;
namespace FirstConsoleApp
{
? ? internal class Program
? ? {
? ? ? ? static void Main(string[] args)
? ? ? ? {
? ? ? ? ? ? double money = 60000.00;//存款金額
? ? ? ? ? ? if (money >= 10000)
? ? ? ? ? ? {
? ? ? ? ? ? ? ? if (money >= 50000)
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? if (money >= 100000)
? ? ? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? ? ? Console.WriteLine("送一臺微波爐");
? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? else
? ? ? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? ? ? Console.WriteLine("送一套茶具");
? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? }
? ? ? ? ? ? else
? ? ? ? ? ? {
? ? ? ? ? ? ? ? Console.WriteLine("送一袋大米");
? ? ? ? ? ? ?}
? ? ? ? ? ??
? ? ? ? ? ?}else
? ? ? ? ? ? {
? ? ? ? ? ? ? ? Console.WriteLine("沒有禮品");
? ? ? ? ? ? }//請在這里補充多重條件判斷
? ? ? ? }
? ? }
}
我這個應該是對的