1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 using System.Threading.Tasks; 6 7 namespace HellowWorld 8 { 9 /// <summary> 10 /// 该程序实现向控制台输出一条消息 11 /// </summary> 12 /// <param name="args"></param> 13 class Program 14 { 15 //程序的入口 16 static void Main(string[] args) 17 { 18 /*从这里开始编写代码*/ 19 //法一 20 Console.WriteLine(); 21 //法二 22 Console.WriteLine("hellow world");//向控制台输出一句话 23 int a = 0; 24 Console.WriteLine(a);//输出变量 25 //法三 26 string str0 = "world"; 27 string str1 = "!"; 28 Console.WriteLine("hello \n{0}\t{1}", str0,str1); 29 Console.ReadLine();//使输出显示暂停 30 } 31 } 32 }
相关文章: