如何在 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