C#While循环
using System;namespace demo_01{ class Program { static void Main(string[] args) { //声明两个简单整数变量a,b int a = 1; int b = 3; while (a>b) { Console.WriteLine("这个while循环条件不成立,不能执行,继续交给下个while判断吧!"); } while (a<b) { Console.WriteLine("循环条件成立,无限循环中..............."); } } }}
启动cmd 查看期望值
结果会无限输出下去…
我们也可以将这种循环叫做死循环
开发者涨薪指南
48位大咖的思考法则、工作方式、逻辑体系