基础

namespace ConsoleApplication1//命名空间
{
class Program//类
{
//主函数:程序的入口,一个程序有且只有一个入口
static void Main(string[] args)
{
/*
//在Main函数中开始写程序
Console.Write("hello world");//输出
Console.ReadLine();//用户录入,可以用来防止控制台运行完之后关闭
*/
/*
int a;
a = 12;
int b = 3;

int c = a + b;
*/
int a, b, c;
a=12;
b=3;
a=2;
c = a + b;
Console.WriteLine(c);
//常量
const int d = 7;

string str = "hello world";
Console.Write(str);

Console.ReadLine();
}
}
}

原文地址:https://www.cnblogs.com/weiwenxin01/p/5342929.html