联系方式

  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp

您当前位置:首页 >> Python编程Python编程

日期:2019-04-18 10:03

QUIZ 7

COMP9021 PRINCIPLES OF PROGRAMMING

$ python3 quiz_7.py

Enter four integers: 0 2 2 8

Here is the grid that has been generated:

1 1 0 1 1 1 1 1

1 0 0 1 0 0 1 0

Enter four integers: 3 0 4 1

Will compute the number of good paths from (3, 0) to (4, 1)...

There is no good path.

$ python3 quiz_7.py

Enter four integers: 0 2 5 5

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

Enter four integers: 0 0 4 4

Will compute the number of good paths from (0, 0) to (4, 4)...

There is no good path.

$ python3 quiz_7.py

Enter four integers: 0 100 1 10

Here is the grid that has been generated:

1 1 1 1 1 1 1 1 1 1

Enter four integers: 2 0 4 0

Will compute the number of good paths from (2, 0) to (4, 0)...

There is a unique good path.

$ python3 quiz_7.py

Enter four integers: 0 100 1 10

Here is the grid that has been generated:

1 1 1 1 1 1 1 1 1 1

Enter four integers: 2 0 5 0

Will compute the number of good paths from (2, 0) to (5, 0)...

There is no good path.

$ python3 quiz_7.py

Enter four integers: 0 3 3 4

Here is the grid that has been generated:

1 1 0 1

1 1 1 1

1 1 1 0

Enter four integers: 1 0 2 1

Will compute the number of good paths from (1, 0) to (2, 1)...

There are 7 good paths.

Date: Trimester 1, 2019.

2 COMP9021 PRINCIPLES OF PROGRAMMING

$ python3 quiz_7.py

Enter four integers: 0 3 3 4

Here is the grid that has been generated:

1 1 0 1

1 1 1 1

1 1 1 0

Enter four integers: 1 0 3 1

Will compute the number of good paths from (1, 0) to (3, 1)...

There are 6 good paths.

$ python3 quiz_7.py

Enter four integers: 0 4 6 5

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

Enter four integers: 0 0 3 5

Will compute the number of good paths from (0, 0) to (3, 5)...

There are 5 good paths.

$ python3 quiz_7.py

Enter four integers: 0 6 12 4

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 1

0 1 0 1

1 1 1 0

1 1 1 1

1 1 1 1

1 1 1 0

1 0 0 1

Enter four integers: 1 0 2 10

Will compute the number of good paths from (1, 0) to (2, 10)...

There are 3979 good paths.


版权所有:编程辅导网 2021 All Rights Reserved 联系方式:QQ:99515681 微信:codinghelp 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。 站长地图

python代写
微信客服:codinghelp