• 0806 c#总复习


     //int a = 5;
                //a++;
                //++a;
                //Console.WriteLine(a);
                //Console.ReadLine();

                //int a = 5;
                ////int b = ++a;//a=a+1;int b=a;
                ////int c = a++;//int c=a;a=a+1;
                //int b = a++;
                //int c = ++a;
                //Console.WriteLine(a+" "+b+" "+c);
                //Console.ReadLine();


                //int a = 8;
                //a += 5;//a=a+5;
                //Console.WriteLine(a);

                //语句的分类:顺序、分支、循环
                //分支
                //格式1:if(){}        若满足就进,不满足就跳
                //格式2:if(){} else{}     二选一
                //格式3:if(){} else if(){} ... else{}     多选一
                //格式4:if的嵌套     在规定好大范围之后还有什么小的情况
                //switch case   相对于格式3来规定的   多选一
                //所有的switch case都可以写成if else的情况
                //但并不是所有的if else 都可以写成switch case


                //循环语句
                //四要素:初始条件,循环条件,循环体,状态改变
                //for循环
                //for (int i = 0; i < 5; i++)
                //{
                //    Console.WriteLine("Hello");
                //}
                //Console.ReadLine();

                //for循环的嵌套
                //打印矩阵
                //for (int i = 0; i < 5; i++)
                //{
                //    for (int j = 0; j < 5; j++)
                //    {
                //        Console.Write("■");
                //    }
                //    Console.WriteLine();
                //}
                //Console.ReadLine();

                //循环能够解决的问题类型
                //穷举:将所有可能的情况都走一遍,使用if筛选出来需要的情况
                //迭代:利用现有的条件不断求解中间情况,最终推导出结果

                //while循环
                //int i = 0;
                //while (i < 5)
                //{
                //    Console.WriteLine("Hello");
                //    i++;
                //}

                // do  while
                //不管满不满足while后面的表达式,都需要先去执行一遍
                //int a = 5;
                //do{
                //    Console.WriteLine("你好");
                //}while(a>10);
                //Console.ReadLine();


                //函数格式
                //格式1:无参无返  public void hanshu(){}
                //格式2:无参有返  public int hanshu(){return 1;}
                //格式3:有参有返  public int hanshu(int a){return 1;}
                //格式4:有参无返  public void hanshu(int a){}

  • 相关阅读:
    CodeSmith将模板文件批量生成文件的方法
    VSFTP
    Retrieving the COM class factory for component with CLSID … failed due to the following error: 80070005.
    简单的centos 5.3 LEMP以及vsftpd配置
    jQuerySelectors(选择器)的使用(一、基本篇)
    文件服务器 之 VSFTPD的高手篇
    jQuery常用技巧大放送
    google ads 黑名单目录
    “VPS FTP应用”目录存档
    用上了LNMP,一键安装实在爽,速度杠杠的 用上了LNMP,一键安装实在爽,速度杠杠的
  • 原文地址:https://www.cnblogs.com/a12110303043/p/5749759.html
Copyright © 2020-2023  润新知