QUIZ 7-无代写
时间:2023-04-08
QUIZ 7
COMP9021 PRINCIPLES OF PROGRAMMING
$ python3 quiz_7.py
Enter three integers: 0 10 0
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
The longest paths made up of consecutive numbers starting from 0 go up to 0.
There are 100 such paths.
$ python3 quiz_7.py
Enter three integers: 0 6 34
Here is the grid that has been generated:
24 26 2 16 32 31
25 19 30 22 13 32
8 18 8 6 16 34
9 19 6 4 21 30
6 22 27 20 13 30
28 33 16 3 0 5
The longest paths made up of consecutive numbers starting from 0 go up to 0.
There is one such path.
$ python3 quiz_7.py
Enter three integers: 0 4 1
Here is the grid that has been generated:
1 1 0 1
1 1 1 1
1 0 0 1
0 0 1 0
The longest paths made up of consecutive numbers starting from 0 go up to 1.
There are 12 such paths.
Date: Trimester 1, 2023.
2 COMP9021 PRINCIPLES OF PROGRAMMING
$ python3 quiz_7.py
Enter three integers: 0 4 2
Here is the grid that has been generated:
1 1 0 1
2 1 1 1
1 1 2 0
2 0 1 0
The longest paths made up of consecutive numbers starting from 0 go up to 2.
There are 4 such paths.
$ python3 quiz_7.py
Enter three integers: 0 8 4
Here is the grid that has been generated:
3 3 0 2 4 3 3 2
3 2 4 1 4 1 2 1
0 4 2 4 4 1 2 0
0 2 3 4 0 2 3 2
4 1 4 3 3 4 2 0
4 0 0 3 0 4 3 2
1 2 0 1 4 1 1 1
4 3 0 0 2 4 3 0
The longest paths made up of consecutive numbers starting from 0 go up to 4.
There are 3 such paths.
$ python3 quiz_7.py
Enter three integers: 0 12 1
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 0 0 0 0 0 0 0 1
0 1 0 0 0 0 0 0 1 0 0 0
1 0 1 0 0 0 1 1 1 0 0 1
0 0 1 0 1 1 1 0 0 0 0 0
The longest paths made up of consecutive numbers starting from 0 go up to 1.
There are 122 such paths.
QUIZ 7 3
$ python3 quiz_7.py
Enter three integers: 0 12 2
Here is the grid that has been generated:
1 1 0 1 2 1 1 1 1 1 2 0
2 0 1 0 0 2 1 2 2 2 0 1
0 2 0 2 1 1 2 0 1 1 1 2
2 0 2 1 1 2 1 0 2 0 0 2
1 2 2 2 0 2 1 1 0 2 1 2
0 0 2 0 0 0 2 1 0 0 1 2
1 0 1 2 1 2 0 2 1 2 0 2
2 2 1 1 0 2 1 1 2 0 1 0
0 0 0 2 2 1 1 0 0 2 0 0
0 0 2 2 2 1 2 2 1 2 0 0
2 2 1 2 1 1 1 2 2 2 1 0
1 2 0 1 2 2 1 0 0 0 2 1
The longest paths made up of consecutive numbers starting from 0 go up to 2.
There are 53 such paths.
$ python3 quiz_7.py
Enter three integers: 0 12 3
Here is the grid that has been generated:
3 3 0 2 3 3 2 3 2 1 1 2
1 0 2 1 2 0 0 2 3 0 2 3
2 1 3 3 2 0 0 0 3 0 3 2
1 2 0 1 1 1 1 3 0 0 2 3
0 2 2 0 2 1 2 3 0 3 2 1
2 1 1 1 0 2 3 0 0 1 1 0
0 3 2 1 1 3 2 3 3 2 0 2
0 3 2 1 1 0 2 0 1 2 1 2
3 0 0 1 1 0 0 0 0 1 0 3
0 2 0 0 0 1 1 0 3 1 0 0
3 0 2 0 1 0 2 2 3 1 0 3
0 0 3 1 2 2 3 1 1 0 1 1
The longest paths made up of consecutive numbers starting from 0 go up to 3.
There are 12 such paths.
$ python3 quiz_7.py
Enter three integers: 0 12 4
Here is the grid that has been generated:
3 3 0 2 4 3 3 2 3 2 4 1
4 1 2 1 0 4 2 4 4 1 2 0
0 2 3 4 0 2 3 2 4 1 4 3
3 4 2 0 4 0 0 3 0 4 3 2
1 2 0 1 4 1 1 1 4 3 0 0
2 4 3 0 2 4 2 0 4 2 4 1
4 4 4 2 3 0 4 3 2 4 1 2
1 1 1 0 4 2 3 0 0 1 1 0
0 4 3 4 2 4 1 1 4 3 4 2
3 3 2 0 2 4 0 3 4 2 1 1
0 2 0 1 2 1 2 3 0 0 1 1
0 4 4 4 0 0 0 1 4 4 0 3
The longest paths made up of consecutive numbers starting from 0 go up to 4.
There is one such path.
4 COMP9021 PRINCIPLES OF PROGRAMMING
$ python3 quiz_7.py
Enter three integers: 0 12 5
Here is the grid that has been generated:
3 3 0 2 4 3 3 2 3 2 4 1
4 1 2 1 0 4 2 4 5 4 1 2
0 5 0 5 2 3 4 0 2 3 2 4
5 1 4 3 3 4 2 0 4 0 0 5
3 5 5 5 0 4 3 2 1 5 2 5
0 1 4 1 1 1 4 3 0 0 2 4
3 0 2 4 2 5 0 4 2 4 1 4
4 4 2 3 0 4 3 2 4 1 2 1
1 1 0 4 5 2 3 0 0 5 1 1
0 0 5 4 5 3 5 4 2 4 1 1
5 4 3 4 2 3 3 5 5 5 2 0
2 4 0 3 4 5 2 1 1 0 5 2
The longest paths made up of consecutive numbers starting from 0 go up to 4.
There are 4 such paths.
$ python3 quiz_7.py
Enter three integers: 0 12 6
Here is the grid that has been generated:
6 3 6 3 0 2 4 3 3 6 6 2
3 2 4 1 4 1 2 1 6 0 4 6
2 4 5 6 4 1 2 0 5 0 6 5
2 3 4 0 2 3 2 4 5 1 4 3
3 6 4 2 0 6 4 0 0 5 6 3
5 6 6 5 5 0 4 3 6 6 2 1
5 2 5 6 0 1 4 1 1 6 1 6
4 3 0 0 2 4 3 0 2 4 2 5
0 4 2 6 4 1 6 4 4 4 2 3
0 4 6 3 2 4 1 2 1 1 6 1
0 4 5 2 3 0 0 5 6 1 1 0
6 0 5 6 4 5 3 6 5 4 2 4
The longest paths made up of consecutive numbers starting from 0 go up to 2.
There are 3 such paths.