大神求解答
using System;
using System.Collections.Generic;
using System.Text;
namespace Test
{
??? class Program
??? {
??????? static void Main(string[] args)
??????? {
??????????? double price = 4388;//手機(jī)的售價(jià)
??????????? double salary = 4978.67;//本月實(shí)發(fā)工資
?????????? if
?????????? (salary>=price)//請(qǐng)?jiān)谶@里補(bǔ)充條件判斷
{Console.WriteLine("這月工資夠買(mǎi)手機(jī)!");}
??????? }
??????? else
??????? {Console.WriteLine("這月工資不夠買(mǎi)手機(jī)!");}
??? }
}
2018-07-11
else前面有兩個(gè)}},說(shuō)明你的中括號(hào)不配對(duì),檢查一下
2018-09-29
using System;
using System.Collections.Generic;
using System.Text;
namespace Test
{
? ? class Program
? ? {
? ? ? ? static void Main(string[] args)
? ? ? ? {
? ? ? ? ? ? double price = 4388;//手機(jī)的售價(jià)
? ? ? ? ? ? double salary = 4978.67;//本月實(shí)發(fā)工資
? ? ? ? ? ? //請(qǐng)?jiān)谶@里補(bǔ)充條件判斷
? ? ? ? ? ? if(salary>=price){
? ? ? ? ? ? ? ? Console.WriteLine("這月工資夠買(mǎi)手機(jī)!");
? ? ? ? ? ? }else{
? ? ? ? ? ? ? ? Console.WriteLine("這月工資不夠買(mǎi)手機(jī)!");
? ? ? ? ? ? }
? ? ? ? }
? ? }
}
2018-07-12
兄弟你把
else{Console.WriteLine("這月工資不夠買(mǎi)手機(jī)!");}
給寫(xiě)到Main函數(shù)外面去了啊。。。。。。。你仔細(xì)看一下
2018-07-10
這個(gè)錯(cuò)在哪了