using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace HelloWorld
{
class Program
{
static void Main(string[] args)
{
for (int i = 0; i < 3;i++ )
System.Console.WriteLine("{0}:Hello World!",i);
System.Console.ReadLine();//为了便于查看上面打印三个HelloWorld的结果
}
}
}
说明:该程序为:Windows Console Application
打印三个hello World
Main函数是该项目的启动入口。
在控制台应用程序中默认引用包括:System,System.Data,System.Xml
运行结果如下:
0:Hello World!
1:Hello World!
2:Hello World!
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace HelloWorld
{
class Program
{
static void Main(string[] args)
{
for (int i = 0; i < 3;i++ )
System.Console.WriteLine("{0}:Hello World!",i);
System.Console.ReadLine();//为了便于查看上面打印三个HelloWorld的结果
}
}
}
说明:该程序为:Windows Console Application
打印三个hello World
Main函数是该项目的启动入口。
在控制台应用程序中默认引用包括:System,System.Data,System.Xml
运行结果如下:
0:Hello World!
1:Hello World!
2:Hello World!
本文介绍了一个简单的C#控制台应用程序示例,该程序使用for循环三次输出Hello World!,并展示如何暂停程序以便观察输出结果。
869

被折叠的 条评论
为什么被折叠?



