|
![]() | 作者: xzxdt916 [xzxdt916]
![]() |
登录 |
地主 发表时间: 03/14 00:28 |
![]() | 回复: songyi1999 [songyi1999] ![]() |
登录 |
有 |
B1层 发表时间: 03/16 22:10 |
![]() | 回复: 54183710 [hcz] ![]() |
登录 |
有就说一下呀 |
B2层 发表时间: 05/03 12:10 |
![]() | 回复: cimsxiyang [cimsxiyang] ![]() |
登录 |
rand() |
B3层 发表时间: 05/04 11:46 |
![]() | 回复: dizi0774 [dizi0774] ![]() |
登录 |
用randomize();随机数初始化。 random();和rand();获得随机数。 |
B4层 发表时间: 05/04 19:15 |
![]() | 回复: none [onizuka] ![]() |
登录 |
int a; randomize(); a=1+random(100);/*from 1 to 100*/ or a=1+rand()%100; |
B5层 发表时间: 05/11 16:08 |
![]() | 回复: easyking [easyking] ![]() |
登录 |
#include <stdlib.h> #include <stdio.h> int main(void) { int i; printf("Ten random numbers from 0 to 99\n\n"); for(i=0; i<10; i++) printf("%d\n", rand() % 100); return 0; } #include <stdlib.h> #include <stdio.h> #include <time.h> /* prints a random number in the range 0 to 99 */ int main(void) { randomize(); printf("Random number in the 0-99 range: %d\n", random (100)); return 0; } #include <stdlib.h> #include <stdio.h> #include <time.h> int main(void) { int i; randomize(); printf("Ten random numbers from 0 to 99\n\n"); for(i=0; i<10; i++) printf("%d\n", rand() % 100); return 0; } |
B6层 发表时间: 06/24 21:27 |
|
20CN网络安全小组版权所有
Copyright © 2000-2010 20CN Security Group. All Rights Reserved.
论坛程序编写:NetDemon
粤ICP备05087286号