如何在 C# 中編寫“你好,世界”?
若要在 C# 中列印“你好,世界”,請使用 Console.WriteLine。
讓我們看一個基本的 C# 程式來顯示文字 −
示例
using System;
using System.Collections.Generic;
using System.Text;
namespace Program {
class MyApplication {
static void Main(string[] args) {
Console.WriteLine("Hello World");
Console.Read();
}
}
}輸出
Hello World
上面,我們使用 WriteLine() 方法顯示了文字“你好,世界”。輸出使用 Console 顯示 −
Console.WriteLine("Hello World");
廣告
資料結構
網路
關係資料庫管理系統
作業系統
Java
iOS
HTML
CSS
Android
Python
C 程式設計
C++
C#
MongoDB
MySQL
Javascript
PHP