long l;
while(1)
{
l=rand()%200;
if(l>100)
break;
}

解决方案 »

  1.   

    int i;
    srand( (unsigned)time(NULL));i = rand()%101 + 100;
      

  2.   

    srand((unsigned)time(NULL));
    int nRand = rand() %100 + 100;
      

  3.   

    #include <stdlib.h>
    #include <stdio.h>
    #include <time.h>void main( void )
    {
       int i;   /* Seed the random-number generator with current time so that
        * the numbers will be different every time we run.
        */
       srand( (unsigned)time( NULL ) );   /* Display 10 numbers. */
       int random = (rand()*100)/0x7fff + 100;  
    }
      

  4.   

    呵呵,要100<= nRand <= 200的话,xuying() 对了
      

  5.   


    long l;
    while(1)
    {
    l=rand()%200;
    if(l>100)
    break;
    }我还是没看懂啊?