-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathgenerator java
31 lines (22 loc) · 1.05 KB
/
generator java
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
import java.io.*;
public class Regenator {
public static void main(String[] args) {
try {
FileWriter writer = new FileWriter("isOdd.txt");//code gen ra se ghi vao file text, file nay o trong cung thu muc voi code
for( int i = min_number; i <= max_number; i++)
if(i % 2 == 0){
writer.write(" if (num === " + i + ") {" + System.getProperty("line.separator"));
writer.write(" return false;" + System.getProperty("line.separator"));
writer.write(" }" + System.getProperty("line.separator"));
}
else {
writer.write(" if (num === " + i + ") {" + System.getProperty("line.separator"));
writer.write(" return true;" + System.getProperty("line.separator"));
writer.write(" }" + System.getProperty("line.separator"));
}
writer.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}