zoukankan      html  css  js  c++  java
  • 语言基础

    语言基础:

       主函数的内容:

    1四要素:名称,输入,输出,加工。

    2输入输出语句

    : Console Write;没有自动换行的输出语句;

       Console Writeline ;有自动换行的输出语句;

       Console ReadLine;输入语句。

       Console ReadKey;输入语句。

    3数据类型:

      字符串类型:string    string a=”hello”; 

                            string b=”h”;

                            String c=”a+b”;

                         Console.WriteLine(“c”);

     数据整型:int     int a=1;

                       int b=2;

                        int c=a+b;

                      Console.WriteLine(c);

    浮点型(小数):double   double a =1.8;  数值少8位。

            decimal   decimal a=1.8M;  需要在后边赋值M,数值多16

    布尔型:bool    True()false(错)只有两种结果

    4:变量,常量

      变量的定义:数据类型 变量名 [=]

                   Int        a   =0;

    5:运算符

      +_*/%加减乘除取  

    Int a=3;

    Int b=7;

    Int c=b%a

    Console.writeLine(c);

    ++——

    Int a=10;

    Int b=a++;

    Int c=a+b

    Console.WriteLine(c);

    ++和后++的区别:++先运算后++后运算

    <=小于等于  >=大于等于  <小于  >大于

    &&并且

    ||

    !非

    条件运算符:int a=10;int b=(a>10)?1:2;

    成立,返还冒号左边的,不成立,返还冒号右边的。

  • 相关阅读:
    ios开发之--UITextField光标右移
    ios开发之--复制到剪切板
    Splash scroll_position 属性
    Splash plugins_enabled 属性
    Splash images_enabled 属性
    Splash resource_timeout 属性
    Splash js_enabled 属性
    Splash args 属性
    Splash 对象属性
    Splash Lua 脚本
  • 原文地址:https://www.cnblogs.com/zhangdemin/p/5458110.html
Copyright © 2011-2022 走看看