![]()
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Text;
5 /// <summary>
6 /// 命名空间 ,用namespace声明
7 /// </summary>
8 namespace ConsoleApplication1
9 {
10 /// <summary>
11 /// 类,用class声明
12 /// </summary>
13 class Program
14 {
15 /// <summary>
16 /// 方法,Main方法是应用的入口点方法,程序运行时,从Main方法开始执行
17 /// </summary>
18 /// <param name="args">参数</param
19 static void Main(string[] args)
20 {
21 string RRG = "阮荣贵";
22 //字符串变量
23 string name = "OK";
24 //字符串数组变量
25 string[] names = new string[] { "Hello","World"};
26 //整型变量 -2147483648到2147483647
27 int myint = -2147483648;
28 uint myuint = 10;
29 long mylong = -2147483649;
30 ulong myulong = 2147483649;
31 //整型数组
32 int[] myints = new int[] { 1,2,3,4,5};
33 //单精度浮点型变量
34 float myfloat = 1.234f;
35 float[] myfloats = new float[] { 1.110f,1.25679F};
36 //双精度浮点型变量
37 double mydouble = 1.00000000;
38 double[] mydoubles = new double[] { 23.05, 32.05, 11};
39 //十进制型变量
40 decimal mydecimal = 1.000M;
41 //布尔型变量
42 bool isOk = false;
43 //布尔型数组
44 bool[] isOks = new bool[] { true,false};
45
46 short myshort = 123;
47 short my16 = myshort;
48
49 Int32 my32 = 456;
50
51 Int64 my64 = 6400;
52
53
54
55
56 }
57 }
58 class myClass
59 {
60 }
61 }