看板 C_Sharp 關於我們 聯絡資訊
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApplication1 { class Program { string a; static void Main(string[] args) { a = Console.ReadLine(); } } } 以上是我的CODE 但為什麼不能通呢? -- Windows 3.1 倉頡輸入 _ By ymzk ┌─────────────────────────────────────┐ │┌──┐┌──┐  ┌────────┐┌───┐ ┌─┐┌──┐│ ││倉頡││半形│請輸入字根:│水土戈   ││ │ │,││鍵盤││ │└──┘└──┘  └────────┘└───┘ └─┘└──┘│ └─────────────────────────────────────┘ -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 180.177.2.7
killer1121:a的內容是什麼? 你只是定義沒有給內容 09/14 20:01
killer1121:想法錯誤..ORZ 09/14 20:11
markov:樓上你是對的 另外值接 Console.ReadLine(); 應該會是pause 09/14 20:17
Harper34:static string a; 09/14 20:18
henry10423:一樓根本講錯,可以直接宣告啊,那是因為版主沒加上sta 09/14 20:52
henry10423:tic,最後還要記得暫停,Console.Readkey(true); 09/14 20:52
s3748679:應該叫樓主吧.... 版主是外面那個 09/15 12:05
MrJerome:錯誤訊息是什麼? 09/15 17:00
optimist9266:去把new關鍵字看懂吧 你在靜態方法呼叫動態欄位 09/15 23:36
tomoyaken14:那裡不通?哪裡出錯? 難道是沒有輸出嗎? @@? 09/16 13:54
johnny94:應該是 string 沒加上 static 09/23 18:28