while循環(huán)用法
while一詞很常見,但我們只記住了while最常見的意思是“當(dāng)……的時(shí)候”,下面就101教育和小編具體了解一下吧,供大家參考。
1while循環(huán)是什么意思
while是計(jì)算機(jī)的一種基本循環(huán)模式。當(dāng)滿足條件時(shí)進(jìn)入循環(huán),進(jìn)入循環(huán)后,當(dāng)條件不滿足時(shí),跳出循環(huán)。while語句的一般表達(dá)式為:while(表達(dá)式){循環(huán)體}。
2英語while的用法是什么
1.while作名詞用,表示“一會(huì)兒”
例:She likes to take a nap for a while after lunch.她喜歡午飯后瞇一會(huì)兒。
2.While作連詞
(1)引導(dǎo)時(shí)間狀語
例:We must strike while the iron is hot.趁熱打鐵。
(2)引導(dǎo)讓步狀語從句,意思是“雖然…但是….”(多放于句首)
例:While he loves China, he finds it hard to live there after being abroad for long time.雖然很愛中國(guó),但旅居海外多年的他還是不適應(yīng)中國(guó)的生活。
(3)引導(dǎo)條件狀語,意思是“只要”
例:While there is life there is hope.留得青山在,不怕沒柴燒。
3.While作并列連詞用,意為“然而”,表對(duì)比關(guān)系。而but表轉(zhuǎn)折。
例:Some people waste food while others haven't enough.有些人很費(fèi)糧食,然而有些人卻吃不飽。
when和while引導(dǎo)的句子可以作過去進(jìn)行時(shí)的時(shí)間狀語,區(qū)別在于:when引導(dǎo)的時(shí)間狀語從句可以接一段時(shí)間或者一個(gè)具體的時(shí)間點(diǎn)while引導(dǎo)的時(shí)間狀語從句只能接一個(gè)時(shí)間點(diǎn)。