Ib nqe lus raws cai yog nqe lus uas tuaj yeem sau rau hauv daim "Yog P ces Q," qhov twg P thiab Q yog kab lus. Rau cov ntsiab lus no, P yog hu ua qhov kev xav thiab Q yog hu ua qhov xaus. Intuitively, "Yog P ces Q" txhais tau tias Q yuav tsum muaj tseeb thaum twg P muaj tseeb.
Ib qho piv txwv ntawm nqe lus muaj cai yog dab tsi?
Ib nqe lus muaj cai muaj ob ntu, qhov kev xav hauv nqe lus "yog" thiab xaus lus hauv "ces" clause. Piv txwv li, "Yog tias nag los, ces lawv rho tsev kawm ntawv." "Nws los nag" yog qhov kev xav. "Lawv rho tsev kawm ntawv" yog qhov xaus.
nqe lus sau cia yog dab tsi?
nqe lus yog cov nqe lus uas qhov kev xav tau ua raws li qhov xaus. Nws tseem hu ua "Yog-thaum ntawd" nqe lus. Yog hais tias qhov kev xav yog qhov tseeb thiab qhov kev txiav txim tsis tseeb, ces cov lus qhia tsis tseeb yog cuav. Ib yam li ntawd, yog tias qhov kev xav tsis tseeb tag nrho cov lus tsis tseeb.
peb nqe lus li cas yog dab tsi?
Cov Lus Qhia: yog, lwm yam, hloov
- Yog nqe lus.
- Yog-Lwm nqe lus.
- Nested If-lse nqe lus.
- Yog-Lwm Yog ntaiv.
- Switch statement.
4 nqe lus hais li cas?
Muaj 4 yam yooj yim ntawm cov xwm txheej: xoom, thawj, thib ob, thiab thib peb. Nws tseem tuaj yeem sib xyaw ua ke thiab siv thawj ntu ntawm akab lus ua ib hom kev cai thiab ntu thib ob ua lwm yam.