c语言中的do while循环语句

 

001、

#include <stdio.h>

int main(void)
{
    int i;
    
    do
    {
        int random;
        
        printf("random = "); scanf("%d", &random);
        if (random % 2)
        {
            puts("odd");
        }
        else
        {
            puts("even");
        }
        
        printf("retry? 0:yes; !0:no; i = "); scanf("%d", &i);
    }
    while( i == 0);     ## 循环控制语句
    
    return 0;
}

 

posted @ 2022-08-12 00:42  小鲨鱼2018  阅读(226)  评论(0编辑  收藏  举报