标题:为什么这个循环只能走两次就退出了
取消只看楼主
hejian11
Rank: 2
等 级:论坛游民
帖 子:35
专家分:49
注 册:2012-10-23
结帖率:0
 问题点数:0 回复次数:0 
为什么这个循环只能走两次就退出了
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<time.h>
void do24();
void main() {
    int a,b,c,d,flg;
    char judge;
    srand((unsigned)time(NULL));
    do {
        printf("--------------------->\n");
        flg = 1;
        a = rand()%13+1;
        b = rand()%13+1;
        c = rand()%13+1;
        d = rand()%13+1;
        printf("a:%d b:%d c:%d d:%d\n",a,b,c,d);
        printf("Do you want to change the numbers 'Y OR N'\n");
        scanf("%c",&judge);
        if (judge == 'Y' || judge == 'y') {
            flg = 1;
        } else {
            flg = 0;
        }
    } while(flg == 1);
    do24();
}

void do24(){
    return;
}
搜索更多相关主题的帖子: numbers include void change 
2012-10-31 14:23



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-385263-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.023148 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved