China Naming Network - Eight-character lottery - Who helps with the random drawing procedure?
Who helps with the random drawing procedure?
# include & ltstdio.h & gt
# include & lttime.h & gt
char Rand();
int main()
{
FILE * fp
if((fp=fopen("result.txt "," w ")= = NULL)
{
Printf ("File creation failed!" );
Returns1;
}
fputc(Rand(),FP);
Returns 0;
}
char Rand()
{
srand(time(NULL));
return rand()% 25+65;
}
Randomly choose capital letters A-Z