官术网_书友最值得收藏!

The while condition

The while condition extends the loop with a condition, as you will see in the following code snippet:

while (condition) 
{ 
    // do something 
} 

Let's take a look at the following example:

fn main() { 
    let mut done = 0u32; 
    while done != 32 
    { 
        println!("done = {}", done); 
        done += 1; 
    } 
} 

The preceding code will output done = 0 to done = 31. The loop terminates when done equals 32.

主站蜘蛛池模板: 中西区| 城固县| 博客| 大方县| 镇雄县| 特克斯县| 五河县| 龙山县| 平舆县| 尚志市| 五原县| 手机| 榕江县| 新蔡县| 乌兰浩特市| 嘉荫县| 阿荣旗| 新兴县| 井冈山市| 清水河县| 炎陵县| 阜新| 郓城县| 广德县| 贵州省| 灌阳县| 永川市| 红桥区| 如皋市| 衡阳县| 施甸县| 巍山| 卓资县| 搜索| 广河县| 涞水县| 太谷县| 平阳县| 永城市| 安仁县| 隆尧县|