首页 > > 详细

COMP9021 Coding Quiz 5

Coding Quiz 5
COMP9021 PRINCIPLES OF PROGRAMMING
Term 3, 2022
$ python3 quiz_5.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_5.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_5.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.
2
$ python3 quiz_5.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_5.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_5.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.
联系我们
  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp
热点标签

联系我们 - QQ: 99515681 微信:codinghelp
程序辅导网!