• 类型转换、运算符'


    using System.Text;
    using System.Threading.Tasks;

    namespace ConsoleApplication1
    {
    class Program
    {
    static void Main(string[] args)
    {

    //while(true):死循环;

    #region:收起来;

    a++:先赋值在运算;

    ++a:先运算再赋值;

    关系运算符:bool接受;

    运算顺序:1)++;--     2)*;/;%;        3)+;—;       4>;<;>=;<=;       5)&&;||

    (特殊:!;();)

    7 的倍数:Console.WriteLine(num%7==0);

    十位数是7:Console.WriteLine(num/10==7);

    个位数是7:Console.WriteLine(num%10==7);

    /*int a;
    a = 1;
    int b = 3;
    int c = a + b;
    Console.WriteLine(c);
    Console.ReadLine(); */

    /* Console.WriteLine("请输入变量a的值");
    string a=Console.ReadLine ();
    Console.WriteLine ("请输入变量b的值");
    string b=Console.ReadLine();
    Console.WriteLine ("a+b的和为:");
    Console.WriteLine(a+b);

    /*int a1=int.Parse (a);
    int b1=int.Parse (b);
    int c=a1+b1;
    Console.WriteLine (c);
    Console.ReadLine ();*/


    /* Console.WriteLine("请输入a的变量");
    string a = Console.ReadLine();
    Console.WriteLine("请输入b的变量");
    string b = Console.ReadLine();
    Console.WriteLine("a+b的和为:");
    Console.WriteLine(a+b);*/
    /* Console.ReadLine();
    int a1 = int.Parse(a);
    int b1 = Convert.ToInt16(b);
    int c = a1 + b1;
    Console.WriteLine(c);*/

    /*double a1 = double.Parse(a);
    double b1 = Convert.Todouble16(b);
    double c = a1 + b1;
    Console.WriteLine(c);*/
    /*int a1 = int.Parse(a);

    int b1 = Convert.ToInt16(b);
    int c = a1 - b1;
    Console.WriteLine(c);*/
    /*double a1 = double.Parse(a);
    double b1 = Convert.Todouble16(b);
    double c = a1 * b1;
    Console.WriteLine(c);*/
    /*int a, b;
    a=6;
    b = 2;
    a = a - b;
    Console.WriteLine(a);*/

    /* int a=1;
    int b = 2;
    string s = a.ToString() + b.ToString();*/
    /* double a =1;
    int b = 3;
    double c = a + b;*/
    /* double a = 1.4;
    int b = 4;
    int c = (int)a + b;

    Console.WriteLine(c);

    Console.ReadLine();*/


    /* Console.Write("请输入数字a:");
    int a=int.Parse( Console.ReadLine());
    Console.Write("请输入数字b:");
    int b=int.Parse(Console.ReadLine());
    /* int c = a + b;
    Console.WriteLine("加法的结果是:"+c);
    c=a-b;
    Console.WriteLine("减法的结果是:"+c);
    c=a*b;
    Console.WriteLine("乘法的结果是:"+c);
    c=a/b;
    Console.WriteLine("除法的结果是:"+c);
    c=a%b;
    Console.WriteLine("取余的结果是:"+c);*/

    /*int c=a++;
    int d=++a;
    Console.WriteLine(c);
    Console.WriteLine(d);
    /* bool c = a < b;*/

    /* Console.WriteLine (c);*/
    /* Console.WriteLine("请输入整数a");
    int a = int.Parse(Console.ReadLine());
    Console.WriteLine("请输入整数b");
    int b = int.Parse(Console.ReadLine());
    int c = a + b;
    Console.WriteLine("减法的结果为:"+a);
    c = a - b;
    Console.WriteLine("乘法的结果为:" + a);
    c = a * b;
    Console.WriteLine("除法的结果为:" + a);
    c = a / b;
    Console.WriteLine("取余的结果为:" + a);
    c = a % b;
    Console.ReadLine();*/
    /*Console.WriteLine("请输入整数a");
    int a = int.Parse(Console.ReadLine ());
    Console.WriteLine("请输入整数b");
    int b = int.Parse(Console.ReadLine ());
    int c= a++;
    int d = ++a;
    Console.WriteLine(c);
    Console.WriteLine (d);
    Console.ReadLine();*/
    /* Console.WriteLine("请输入整数a");
    int a = int.Parse(Console.ReadLine ());
    Console.WriteLine("请输入整数b");
    int b = int.Parse(Console.ReadLine ());*/
    /*bool c = a < b;
    Console.WriteLine(c);
    Console.ReadLine();*/
    /*Console.WriteLine("请输入整数a");
    int a = int.Parse(Console.ReadLine());
    Console.WriteLine("请输入整数b");
    int b = int.Parse(Console.ReadLine ());
    bool c = a == b;
    Console.WriteLine(c);
    Console.ReadLine();*/
    /*Console.WriteLine("请输入整数a");
    int a = int.Parse(Console.ReadLine());
    Console.WriteLine("请输入整数b");
    int b = int.Parse(Console.ReadLine ());
    int c = 15;
    bool l = a > b && c > a;
    Console.WriteLine(l);

    Console.ReadLine();*/
    /*Console.WriteLine("请输入整数a");
    int a = int.Parse(Console.ReadLine());
    Console.WriteLine("请输入整数b");
    int b = int.Parse(Console.ReadLine());
    int c = 8;
    bool k = a < b != b < c;
    Console.WriteLine(k);
    Console.ReadLine();*/
     Console.WriteLine("请输入整数a");
    int a = int.Parse(Console.ReadLine());
    Console.WriteLine("请输入整数b");
    int b = int.Parse(Console.ReadLine ());
    int c=5;
    bool k=!(a<b&&b<c);

     int c = 35;
    bool k = a>b - c - a && c > b;

    int c = 5;
    int d = a - b + c * a++;
     a -= b + 3;
    Console.WriteLine (a);
    Console.ReadLine();

    Console.WriteLine("请输入数字");

    int a = int.Parse(Console.ReadLine());
    string s = a>12 ?"这是时间下午"+(a-12):"这是上午时间"+a;
     string s = a > 60 ? "老年" : "青年" ;
    Console.WriteLine("这个数是一个:"+s);
    Console.ReadLine();


  • 相关阅读:
    Laravel5 cookie和session设置
    php如何实现登陆后返回原页面
    laravel5项目安装debugbar
    phpstorm安装laravel-ide-helper实现自动完成、代码提示和跟踪
    js 3秒后跳转页面的实现代码
    phpstorm常用plugins
    运用Xdebug调试和优化PHP程序
    Laravel5 打印SQL
    laravel 去掉index.php伪静态
    Linux gprof命令
  • 原文地址:https://www.cnblogs.com/yg6405816/p/5313363.html
Copyright © 2020-2023  润新知