第五章:变量

变量:

int表示整数

double表示带小数点的

char表示单个字符

string表示在存储字符串的变量

bool表示判断真假

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Ant1
{
    ///<summary>
    ///1-什么是变量
    ///2-变量的类型
    ///3-声明变量
    ///4-简单使用变量
    ///</summary>>
    class Program
    {
        static void Main(string[] args)
        {
            //int double char string bool
            int int1;//先声明后赋值
            int int2 = 123;//声明时赋值
            int int3, int4,  int5;

            double double1 = 2.00;//带有小数点
            char char1 = 'a';//单个字符
            string str1 = "我的名字叫wang";//字符串
            bool bool1 = true;//两个值 一个false假的意思,另一个true真的意思
            Console.WriteLine(str1);
            Console.Read();
        }
    }
}

运行结果:

 

posted @ 2020-06-03 22:54  进一步海阔天空  阅读(123)  评论(0编辑  收藏  举报