這個為什么輸出不對
? if(salary>=price)
{
? ? Console.WriteLine("這月工資夠買手機!");
}
? ?else
? ?{
? ? ? ?Console.WriteLine("這月工資不夠買手機!");
? if(salary>=price)
{
? ? Console.WriteLine("這月工資夠買手機!");
}
? ?else
? ?{
? ? ? ?Console.WriteLine("這月工資不夠買手機!");
2018-10-04
舉報
2018-10-28
要加中文的感嘆號
2018-10-04
加了只是忘了寫了
2018-10-04
你是最后的大括號忘記加了吧
using System;
using System.Collections.Generic;
using System.Text;
namespace Test
{
? ? class Program
? ? {
? ? ? ? static void Main(string[] args)
? ? ? ? {
? ? ? ? ? ? int salary = 1000;
? ? ? ? ? ? int price = 500;
? ? ? ? ? ? if (salary >= price)
? ? ? ? ? ? {
? ? ? ? ? ? ? ? Console.WriteLine("這月工資夠買手機!");
? ? ? ? ? ? }
? ? ? ? ? ? else
? ? ? ? ? ? {
? ? ? ? ? ? ? ? Console.WriteLine("這月工資不夠買手機!");
? ? ? ? ? ? }
? ? ? ? }
? ? }
}
數字是我隨便加的,可以輸出結果