• 语法部分的练习


    我们来检测一下你对语法的认知程度

    分析以下代码,猜测他的运算结果(我一直认为读代码是程序员必须的基本功,读狗屁代码更是基本功中的基本功)

    我承认以下代码很狗屁,但也要请你来读一下
     1public static void Main(string[] args)
     2        {
     3            for (int i = 0; i < 1000; i++)
     4            {
     5                switch (i)
     6                {
     7                    case 1:
     8                        System.Console.WriteLine(i);
     9                        break;
    10                    case 2:
    11                        System.Console.WriteLine(i);
    12                        break;
    13                    case 50:
    14                        do
    15                        {
    16                            if (i > 60)
    17                            {
    18                                break;
    19                            }

    20                            else
    21                            {
    22                                System.Console.WriteLine(i);
    23                            }

    24                            i++;
    25                        }

    26                        while (i < 70);
    27                        break;
    28                    default:
    29                        while (i < 100)
    30                        {
    31                            i++;
    32                            if (i < 80)
    33                            {
    34                                continue;
    35                            }

    36                            else
    37                            {
    38                                System.Console.WriteLine(i);
    39                            }

    40                        }
     break;
    41                }

    42            }

    43        }
  • 相关阅读:
    Things You Should Know
    因为web.config配置,导致(当前不会命中断点,还没有为该文档加载任何符号)
    【HTML5 Canvas游戏开发】笔记(二) 显示一张图片
    【HTML5 Canvas游戏开发】笔记(一) 概述和基础讲解
    const char* pcr&char* const pcr
    【Python扩展阅读【转】EasyGui 学习文档【超详细中文版】】
    【Python扩展阅读【转】】字符串的方法及注释
    【Python⑥】python的缩进,条件判断和循环
    【Python⑤】python序列---list和tuple
    【Python④】python恼人的字符串,格式化输出
  • 原文地址:https://www.cnblogs.com/shyleoking/p/635382.html
Copyright © 2020-2023  润新知