while语句的用法,if while语句的用法

http://www.itjxue.com  2023-01-08 19:59  来源:未知  点击次数: 

while的用法四种句型是什么?

while的用法四种句型如下:

1、表示时间的用法,其意为“当……的时候”。

如:We must strike while the iron is hot.

我们要趁热打铁。

2、表示让步的用法,其意为“尽管”“虽然”。

如:While the work was difficult, it was interesting.

虽然工作有难度,但很有趣。

3、表示对比的用法,其意为“而”“但”。

如:Air is a fluid but not a liquid, while water is both a fluid and a liquid.

空气是流体不是液体,水是流体也是液体。

4、其省略用法,即主句与从句主语相同,且从句谓语动词含有动词be时,通常可省略从句主语和动词be。

如:While (he was) in prison, she wrote her first novel.

她在狱中写出了第一部小说。

while的用法:

while可引导时间状语从句,意为当……时候。

while可引导让步状语从句,意为虽然、尽管。

while可引导条件状语从句,意为只要。

while可引导原因状语从句,意为既然。

While的用法归纳

下面是我为同学们归纳了While的用法,希望大家可以学以致用!

while的用法可从下述几点理解与运用:

一、while意为“当……时候”,指一段时间,不能用来表示一个时间点。

While the discussion was still going on, George came in. 当讨论还在进行时,乔治走了进来。

二、while意为“而;然而”,表示转折。

There're plenty of rain in the southeast, while there's little in the northeast. 东南部雨量充足,而西北部则很少下雨。

三、while意为“虽然;尽管”,表示让步。

While I admit his good points, I can see his shortcomings. 尽管我承认他的优点,但我还是能看到他的缺点。

四、while意为“只要”,表示条件。

We can surely overcome these difficulties while we are closely united. 只要我们紧密地团结一致,一定能克服这些困难。

五、while从句中的省略。

当while从句中的主语与主句的主语一致,且含有be的某种形式时,从句中的主语连同be可同时省略。

While listening to the radio, she fell asleep. 她在听收音机时睡着了。

While in London, he studied music and painting. 在伦敦时,他学习音乐和绘画。

六、while可用作名词,意为“一会儿;一段时间”。

作名词用时,主要用于 短语 中: after a while “过了一会儿”; all the while “一直,始终”; a short / little while ago “刚才”; once in a while “偶尔,间或”; wait / rest(for) a while “等 / 休息一会儿”。

I haven't seen her for a long while.我好久没有看见她了。

Where have you been all this while?这一阵子你到哪去了?

He usually goes to work by bike, but once in a while he goes by bus. 他通常骑自行车上班,但偶尔也乘公共汽车。

I looked everywhere for the letter, but it was in my pocket all the while. 我到处找那封信,却不知它一直在我口袋里。

七、while与when以及as之间的区别。

1. 当从句中的谓语动词是持续性的动作时,我们可以用while, when或as。

While / When / As I was walking down the street, I noticed a police car in front of the bank.我顺着马路往前走时,发现银行门前停着一辆警车。

2. 当从句中的谓语动词表示瞬间动作时,不可用while。

He was on the point of leaving when someone knocked at the door. 他正要走,这时有人敲门。

3. 如果谈论两个长动作,最常用的是while。

While John was sitting biting his nails, I was working out a plan to get us home. 约翰坐在那里咬指甲时,我想出了一个回家的办法。

不过, as是可以用来说明两种正在发展或变化的情况的,这时as引导一个持续性的动作,主句中的动作与之同时进行。

As we talked on, he got more and more excited. 我们继续往下谈的时候,他越来越兴奋。

4. 如果表示两个短动作或事件同时发生,最常用的是as或just as,也可用when。

Just as he caught the ball, there was a tearing sound. 当他抓住球的时候,有一种撕裂的声音。

I thought of it just when you opened your mouth. 就在你要说话的时候,我也想到了。

while语句的用法是什么?

while语句的原型是while(表达式)语句,当表达式为非0值时,执行while语句中的嵌套语句。

while(1)其中1代表一个常量表达式,它永远不会等于0。循环会一直执行下去。除非你设置break等类似的跳出循环语句循环才会中止。

而while(i--)其中i是一个变量,因此表达式i--有不同的值,依次递减,i--是先取值后减,--i先加后取值,所以i--的值同未执行该自减运算时的i相等。因此当i为0时,循环会跳出。

while语句的一般形式为:

while(表达式)语句

其中表达式是循环条件,语句为循环体。

while语句的语义是:计算表达式的值,当值为真(非0)时, 执行循环体语句。

(责任编辑:IT教学网)

更多

推荐站内动态文章