-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrandom_file.h
111 lines (82 loc) · 1.11 KB
/
random_file.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#include<time.h>
#define RAND_M 23
FILE* random_file()
{
FILE*fp;
int random=-1;
srand(time(NULL));
random=(rand())%RAND_M;
switch(random)
{
case 0:
fp=fopen("./type/a","r");
break;
case 1:
fp=fopen("./type/b","r");
break;
case 2:
fp=fopen("./type/c","r");
break;
case 3:
fp=fopen("./type/e","r");
break;
case 4:
fp=fopen("./type/f","r");
break;
case 5:
fp=fopen("./type/g","r");
break;
case 6:
fp=fopen("./type/h","r");
break;
case 7:
fp=fopen("./type/i","r");
break;
case 8:
fp=fopen("./type/j","r");
break;
case 9:
fp=fopen("./type/k","r");
break;
case 10:
fp=fopen("./type/l","r");
break;
case 11:
fp=fopen("./type/m","r");
break;
case 12:
fp=fopen("./type/n","r");
break;
case 13:
fp=fopen("./type/o","r");
break;
case 14:
fp=fopen("./type/p","r");
break;
case 15:
fp=fopen("./type/q","r");
break;
case 16:
fp=fopen("./type/r","r");
break;
case 17:
fp=fopen("./type/s","r");
break;
case 18:
fp=fopen("./type/t","r");
break;
case 19:
fp=fopen("./type/u","r");
break;
case 20:
fp=fopen("./type/v","r");
break;
case 21:
fp=fopen("./type/w","r");
break;
case 22:
fp=fopen("./type/x","r");
break;
}
return fp;
}