当前位置:编程学习 > wap >>

各位谁能帮我看看这个程序,给他调试成显示100个三位数而不是10个数啊?

                   #include   <stdlib.h> 
#include   <stdio.h> 
#include   <time.h> 

void   main(   void   ) 

      int   i; 
      int   count   =   0;

      srand(   (unsigned)time(   NULL   )   );

      while(count   <   10)
      { 
      i   =   rand(); 
      if((100   <=   i)&&(i   <=   999)) 
      { 
      printf(   "%d\t%6d\n ",   count,i); 
      count++; 
      } 

      }
      getch();
}
--------------------编程问答-------------------- while(count < 100) --------------------编程问答-------------------- ……

count 是计数的。
补充:移动开发 ,  移动开发其他问题
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,