2018-06-23

2018-09-08  本文已影响0人  baixuetang11

python中While

while count < 5:

           print count, " is  less than 5"  count = count + 1

else:

       print count, " is not less than 5"

while(condition)

    {//code to be executed }

java中do...while循环的语法是:

do {

     //Statements 

}while(Boolean_expression);

while(condition)

    {//code to be executed }

C语言中While

do{ 

         statement(s);

}while( condition);

do

{

s=s+i;                  /*求一千以内奇数的和*/

i=i+2;            /*这里是循环体*/

}

while(i<=1000);  /*不要忘记分号,while这写条件,不满足则退出程序*/

printf("一千以内奇数的和为:%d\n",s);

while(condition)

    {//code to be executed }

VB中While

Do [while|Until ] 条件

语句1

语句2

语句N

Loop 

Do 

语句1

语句2

语句N

Loop  [while|Until ] 条件

上一篇 下一篇

猜你喜欢

热点阅读