#include
#include
int main()
{
system("color 1f");
int i;
printf("RAND_MAX is %u\n", RAND_MAX);
srand(time(0));
printf("random values from 0 to RAND_MAX\n");
for(i=0;i<50 font="" i="">50>
printf("%d\n", rand());
printf("randon values from 1 to 100\n");
for(i=0;i<50 font="" i="">50>
printf("%d\n",(rand()%100)+1);
system("pause");
}
#include
int main()
{
system("color 1f");
int i;
printf("RAND_MAX is %u\n", RAND_MAX);
srand(time(0));
printf("random values from 0 to RAND_MAX\n");
for(i=0;i<50 font="" i="">50>
printf("%d\n", rand());
printf("randon values from 1 to 100\n");
for(i=0;i<50 font="" i="">50>
printf("%d\n",(rand()%100)+1);
system("pause");
}
Comentários
Postar um comentário