VC 产生0和1的随机数

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

void main()

    srand((unsigned)time(NULL)); 
    
for(int i = 0; i < 10;i++ ) 
        printf( 
"%d\n", rand() % 2); 

posted on 2008-12-27 21:24 大豆男生 阅读(514) 评论(0) 编辑 收藏

导航

公告

统计