定义变量

     /*
     数据类型  变量名;
     数据类型  变量名=值;
     数据类型  变量1,变量2,...变量n
    */     
     /*
      int a;   
      a=12;

      int b=3;

       int c=a+b;
      */
       int a,b,c;
       a=12;
       b=3;
       c=a+b;
       Console.WriteLine(c);    //输出并换行
 
        const int d=7;//常量,不能再赋值

        string str="hello world";
        Console.Write(str);     //输出不换行

        Console.ReadLine();

 

posted @ 2016-03-30 10:10  凌零聆  阅读(163)  评论(0编辑  收藏  举报