(String[] args)
| 6 | } |
| 7 | |
| 8 | public static void main(String[] args) { |
| 9 | for (int i = 0; i < 10; i++) { |
| 10 | Line line1 = new Line(randomInt(5), randomInt(1)); |
| 11 | Line line2 = new Line(randomInt(5), randomInt(2)); |
| 12 | line1.print(); |
| 13 | System.out.print(", "); |
| 14 | line2.print(); |
| 15 | if (line1.intersect(line2)) { |
| 16 | System.out.println(" YES"); |
| 17 | } else { |
| 18 | System.out.println(" NO"); |
| 19 | } |
| 20 | } |
| 21 | } |
| 22 | |
| 23 | } |