COMP9021 PRINCIPLES OF PROGRAMMING


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.

因为专业,所以值得信赖。如有需要,请加QQ99515681 或邮箱:99515681@qq.com 

微信:codinghelp

转载于:https://www.cnblogs.com/simplepython/p/10746616.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值