第2个程序(变量1 int)

Posted 思维乐趣

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了第2个程序(变量1 int)相关的知识,希望对你有一定的参考价值。

namespace _01变量
{
class Program
{
static void Main(string[] args)
{
int number;    //定义一个叫number的变量  (声明变量的语法格式: 数据类型 变量名;)
number = 1000;   //并且给变量number赋值1000
Console.WriteLine(number);    //向控制台输出变量number值=1000  注意此处不能加双引号 加了则表示将括号中的内容原封不动的输出 ;不加则是输出定义好的number值1000.
Console.ReadKey();
}
}
}

以上是关于第2个程序(变量1 int)的主要内容,如果未能解决你的问题,请参考以下文章