下面是引用 sk@.@ 于 2010-11-06 01:54 发表的 第二次试作 修了第1次随机数为42的bug,|猜数字: 
  这我参考版上再改改的
希望给一些意见 ^^
[code]#include <iostream>
#include <stdio.h>
.......
副版大
今天因为自修c语言
在后面习题刚好和副版大的猜数字游戏差不多
因此就以您的原始码改写成c语言的格式
因为std::string again;这小弟不懂成员函数的呼叫
所以就删除了
但是如今却无法在猜完后还能继续的玩
如此之故
不知可否请教副版大
这程式码要怎么改才可以
谢谢
底下是小弟改写的方式
大部份都照大大原码
很不好意思
在此请教了
#include <stdio.h> 
#include <stdlib.h>
#include <time.h> 
#include <conio.h>
int main( int argc, char *argv [] )
{ 
    char again;
    int byby = 5;
    srand((unsigned) time(NULL));  //刚更新 ^^   
    int min = 0, max = 99, round = 0, this_round = rand()%100+0; 
    int player;      
    while(byby == 5) 
    {           printf(" max=%d; min=%d;\n",max,min);     
                printf("I Guess :"); 
                scanf("%d",&player); 
                printf("\n");                 
                if (player <= min || player >= max) 
                { 
                           printf("注意!!!\n") ;                             
                           if (player <= min) 
                            player = min; 
                           else if (player >= max) 
                                player = max; 
                } 
                else 
                { 
                if (player == this_round) 
                { 
                           if (round == 0) 
                           { 
                                    printf("真厉害!! 一次就猜中!"); 
                                     printf("另起新局?  (Y/N)" ); 
                                     printf("   ------>"); 
                                     again=getche();                                       
                                     if(again=='Y'||again=='y') 
                                     { 
                                               min = 0; 
                                               max = 99; 
                                               round = 0; 
                                               this_round = rand () % 100 + 0; 
                                     } 
                                     else 
                                               break; 
                           } 
                           else 
                           {                     
                                                printf( "\n..bingo.. 猜数字游戏 %d次猜中 \n", round);                                                                             
                                                printf("另起新局?  (Y/N)");   
                                                printf("   ------>"); 
                                                scanf("%c",&again);                                                 
                                                if (again == 'Y' || again == 'y') 
                                                { 
                                                          min = 0; 
                                                          max = 99; 
                                                          round = 0; 
                                                          this_round = rand () % 100 +0; 
                                                } 
                                                else 
                                                       break;    
                           } 
                } 
                else 
                { 
                    if (player > this_round) 
                    { 
                               max = player;
                               printf("数目猜小一点\n"); 
                    } 
                    else 
                    { 
                        min = player;
                        printf("数目猜大一点\n"); 
                    } 
                    round += 1; 
                } 
                } 
    }    
     system("pause");
     return 0;
}