Dab tsi yog Do Thaum Loop nqe lus?
Dab tsi yog Do Thaum Loop nqe lus?

Video: Dab tsi yog Do Thaum Loop nqe lus?

Video: Dab tsi yog Do Thaum Loop nqe lus?
Video: Yog ntuj tsis pab ntshe kuv tuag lawm 8/6/2018 2024, Tej zaum
Anonim

Nyob rau hauv feem ntau lub computer programming lus, a ua thaum lub voj voog yog kev tswj kev khiav nqe lus uas executes ib block ntawm code tsawg kawg ib zaug, thiab ces rov ua lub block, los yog tsis, nyob ntawm ib tug muab boolean mob thaum kawg ntawm lub block. Yog hais tias muaj tseeb, lub code executes lub cev ntawm lub lub voj dua.

Tib neeg kuj nug, qhov txawv ntawm thaum thiab ua thaum lub voj voog?

Ntawm no, lub ntsiab qhov sib txawv ntawm a thaum voj thiab ua thaum lub voj voog yog tias thaum voj xyuas cov xwm txheej ua ntej iteration ntawm lub lub voj . Ntawm qhov tod tes, lub ua - thaum voj txheeb xyuas qhov xwm txheej tom qab ua tiav ntawm cov lus hauv lub lub voj.

Ib yam li ntawd, ua li cas thaum lub voj hauv C nrog piv txwv? Hauv ua - thaum voj , cev a lub voj yog ib txwm raug tua tsawg kawg ib zaug. Tom qab lub cev raug tua, ces nws xyuas qhov mob. Yog tias qhov xwm txheej muaj tseeb, ces nws yuav rov ua lub cev ntawm a lub voj txwv tsis pub tswj yog pauv tawm ntawm lub lub voj.

Dab tsi yog Ua Thaum Loop qauv?

Cov ua thaum lub voj voog xyuas qhov xwm txheej ntawm qhov kawg lub voj . Qhov no txhais tau hais tias cov lus nyob hauv lub lub voj lub cev yuav raug tua tsawg kawg ib zaug txawm tias qhov xwm txheej tsis muaj tseeb. Cov ua thaum lub voj voog yog kev tawm mus tswj lub voj , qhov twg txawm tias qhov kev kuaj mob tsis tseeb, lub lub voj lub cev yuav raug tua tsawg kawg ib zaug.

Ua Thaum vs Thaum Loop?

“ Thaum yog kev nkag-tswj lub voj uas thawj zaug kuaj xyuas tus mob, ces executes code. Ua - thaum yog kev tawm-tswj lub voj uas ua ntej executes code, ces xyuas cov mob.

Pom zoo: