zoukankan      html  css  js  c++  java
  • 《21天学通C#》变量使用前需要声明和赋值,赋值后可以重新赋新的值

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

    namespace 变量声明赋值使用
    {
    class Program
    {
    static void Main(string[] args)
    {
    //变量使用之前需要声明和赋值
    //声明 my_variable
    int my_variable;

    //赋值给my_variable
    my_variable = 5;
    Console.WriteLine(" my_variable contains the value {0}", my_variable);

    //给my_variable赋一个新的值
    my_variable = 100;
    Console.WriteLine(" my_variable contains the value {0}", my_variable);

    Console.WriteLine("按任意键退出程序!");
    Console.ReadKey();
    }
    }
    }

  • 相关阅读:

    (luogu)[模板]最长公共子序列
    表达式的值
    邮票面值设计
    尼克的任务
    HISTOGRA
    消防局的设立
    青蛙的约会
    产生数
    奇怪的电梯
  • 原文地址:https://www.cnblogs.com/nnty/p/9909758.html
Copyright © 2011-2022 走看看