美文网首页
c#Lesson01

c#Lesson01

作者: Class_Lee | 来源:发表于2018-01-09 17:15 被阅读0次

    //introduction of system fuction
    using System;

    //name space命名空间

    //class
    class MainClass
    {
    //main method
    //A program starts with the main method and ends with the main method
    //A program has only one main method

    /// <summary>
    /// The entry point of the program, where the program control starts and ends.
    /// </summary>
    /// <param name="args">The command-line arguments.</param>
    public static void Main (string[] args)
    {
    
        /*
             * 多行注释中可以包含回车
            */
        /*
        //All the programs written earlier must be written in the main method
        //在计算机中 最小存储单位 位 bit
        //在计算机中 最小的使用单位 字节 Byte
        //1字节 = 8位
    
        //变量 就是一块内存
        //创建变量: 从一整块内存中,获取一小块内存
        //定义变量
        //数据类型 变量名 = 值
        //整型
        //这里说的变量指的是 n1
        int n1 = 10;
        //如果想改变变量中的值
        n1 = 20;
        //系统提供的,作用将指定的数据输出到控制台
        Console.WriteLine (n1);
    
        //浮点型 单精度
        float f1 = 2.1234567f;
        Console.WriteLine (f1);
    
        //浮点型 双精度
        double f2 = 0.123456789123456789;
        Console.WriteLine (f2);
    
        //bool 布尔类型 true false
        bool b1 = true;
        bool b2 = false;
    
        //字符类型
        char c1 = 'a';
        Console.WriteLine (c1);
    
        //字符串 加双引号
        string c2 = "Hello World!";
        Console.WriteLine (c2);
    
        //命名规范
        //1.只能使用数字、字母、下划线、@组成,数字不能开头,@只能开头
        int @a_1 = 10;
        //2.不可以与系统保留字同名
        //3.不能使用重复的变量名
        int @A_1 = 10;
        //规范
        //4.见名知意
        int age = 18;
        //5.驼峰命名法
        string myNameIs = "Lee";
    
        //不要用
        string 你好 = "Hello";
        Console.WriteLine (你好);
    
        int a1 = 1;
        int a2 = 1;
        int a3 = 1;
        int a4 = 1;
        int a5 = 1;
        int a6 = 1;
        int a7 = 1;
        int a8 = 1;
        int a9 = 1;
        int b11 = 1;
        int b22 = 1;
        int b3 = 1;
        int b4 = 1;
        int b5 = 1;
        int b6 = 1;
        int b7 = 1;
        int b8 = 1;
        int b9 = 1;
    
        bool c = true;
        bool c21 = true;
        bool c3 = true;
        bool c4 = true;
        bool c5 = true;
        bool c6 = true;
        bool c7 = true;
        bool c8 = true;
        bool c9 = true;
        bool d1 = false;
        bool d2 = false;
        bool d3 = false;
        bool d4 = false;
        bool d5 = false;
        bool d6 = false;
        bool d7 = false;
        bool d8 = false;
        bool d9 = false;
    
        char f = 'a';
        char f12 = 'a';
        char f22 = 'a';
        char f3 = 'a';
        char f4 = 'a';
        char f5 = 'a';
        char f6 = 'a';
        char f7 = 'a';
        char f8 = 'a';
        char f9 = 'a';
        char g1 = 'a';
        char g2 = 'a';
        char g3 = 'a';
        char g4 = 'a';
        char g5 = 'a';
        char g6 = 'a';
        char g7 = 'a';
        char g8 = 'a';
        char g9 = 'a';
    
        string h1 = "kk";
        string h2 = "kk";
        string h3 = "kk";
        string h4 = "kk";
        string h5 = "kk";
        string h6 = "kk";
        string h7 = "kk";
        string h8 = "kk";
        string h9 = "kk";
        string u1 = "kk";
        string u2 = "kk";
        string u3 = "kk";
        string u4 = "kk";
        string u5 = "kk";
        string u6 = "kk";
        string u7 = "kk";
        string u8 = "kk";
        string u9 = "kk";
    
        float i1 = 2.5f;
        float i2 = 2.2f;
        float i3 = 2.5f;
        float i4 = 2.8f;
        float i5 = 2.8f;
        float i6 = 2.9f;
        float i7 = 2.8f;
        float i8 = 2.8f;
        float i9 = 2.9f;
        float o1 = 2.8f;
        float o2 = 2.8f;
        float o3 = 2.8f;
        float o4 = 2.8f;
        float o5 = 2.8f;
        float o6 = 2.7f;
        float o7 = 2.7f;
        float o8 = 2.8f;
        float o9 = 2.7f;
    
        double t1 = 2.44;
        double t2 = 2.55;
        double t3 = 2.8787;
        double t4 = 2.578;
        double t5 = 2152.55;
        double t6 = 2.44;
        double t7 = 2.77;
        double t8 = 2.77;
        double t9 = 2.7474;
        double r1 = 2.55;
        double r2 = 2.44;
        double r3 = 2.447;
        double r4 = 2.77;
        double r5 = 2.44;
        double r6 = 2.44;
        double r7 = 2.44;
        double r8 = 32.44;
        double r9 = 2.44;
    
        */
    
        //      string str3 = "1";
        //      bool strBool = bool.Parse (str3);
        //      Console.WriteLine (strBool);
        //
        //
    
    
    }
    

    }

    相关文章

      网友评论

          本文标题:c#Lesson01

          本文链接:https://www.haomeiwen.com/subject/xhdgnxtx.html