辅导案例-QUIZ 6
QUIZ 6 COMP9021 PRINCIPLES OF PROGRAMMING $ python3 quiz_6.py Enter two integers, the second one being strictly positive: 0 1 Here is the grid that has been generated: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 There is no parallelogram with horizontal sides. $ python3 quiz_6.py Enter two integers, the second one being strictly positive: 0 2 Here is the grid that has been generated: 1 1 0 1 1 1 1 1 1 0 0 1 0 0 1 0 1 0 0 1 1 0 1 1 1 0 1 1 1 0 0 0 1 0 1 1 0 1 0 0 0 0 0 1 0 0 1 1 0 1 1 0 1 0 1 1 0 1 1 0 1 0 0 0 0 1 1 0 0 0 0 0 0 1 1 0 0 1 1 1 1 1 0 1 0 1 1 0 0 0 1 0 0 1 0 1 1 0 0 0 The largest parallelogram with horizontal sides has a size of 4. $ python3 quiz_6.py Enter two integers, the second one being strictly positive: 0 3 Here is the grid that has been generated: 1 1 0 1 1 1 1 1 1 1 1 0 1 0 1 0 0 1 1 1 1 1 0 1 0 1 0 1 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 0 1 0 0 1 1 1 1 1 0 1 1 1 0 1 1 1 0 0 1 0 0 0 1 1 0 0 1 1 1 0 1 1 1 1 0 1 1 1 0 1 1 1 1 1 0 1 1 1 1 0 1 0 0 0 0 1 The largest parallelogram with horizontal sides has a size of 12. Date: Term 3, 2019. 2 COMP9021 PRINCIPLES OF PROGRAMMING $ python3 quiz_6.py Enter two integers, the second one being strictly positive: 0 4 Here is the grid that has been generated: 1 1 0 1 1 1 1 1 1 1 1 1 1 0 1 1 1 0 0 1 1 0 1 1 1 1 1 1 1 0 0 0 1 0 1 1 1 1 0 1 1 1 1 1 0 0 1 1 0 1 1 0 1 1 1 1 0 1 1 1 1 1 1 1 0 1 1 0 0 1 1 0 0 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 1 0 1 0 1 1 1 1 1 0 0 1 The largest parallelogram with horizontal sides has a size of 12. $ python3 quiz_6.py Enter two integers, the second one being strictly positive: 1 4 Here is the grid that has been generated: 1 0 1 0 1 1 1 1 1 0 1 0 1 1 0 1 1 1 0 1 0 0 0 0 1 1 1 0 1 1 1 1 1 1 1 1 1 0 1 0 1 1 0 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 0 1 0 1 1 1 1 0 1 0 1 1 1 1 1 0 1 1 1 1 1 1 1 0 1 1 1 1 0 1 1 1 1 1 1 1 1 0 1 1 0 1 The largest parallelogram with horizontal sides has a size of 16. $ python3 quiz_6.py Enter two integers, the second one being strictly positive: 0 5 Here is the grid that has been generated: 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 0 0 1 1 1 0 1 1 1 1 1 1 1 1 1 1 0 1 0 0 1 0 1 1 1 1 1 0 1 1 1 1 1 1 1 0 0 1 1 1 0 1 1 1 0 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 0 1 1 1 0 0 1 1 0 0 1 1 1 The largest parallelogram with horizontal sides has a size of 15.