python - 如何在 SPOJ 问题硬币中使用 Python 输入?

标签 python algorithm input implementation

任何人都可以帮助我如何接受下面问题中描述的输入(提供的链接)。我只想知道输入部分在Python 3.7语言中的实现。请不要分享您对主要问题的回答或逻辑。

https://www.spoj.com/problems/COINS/

最佳答案

while True:
    try:
        value = int(input()) # Bytelandian coins can only have integer values.
    except:
        break
    # your code to find and print the dollars you can make for a coin worth 'value' goes here
    ...

关于python - 如何在 SPOJ 问题硬币中使用 Python 输入?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55340374/

相关文章:

python - 使用 cx_Oracle 读取 LONG RAW

python - 类型错误 : unsupported operand type(s) for -: 'int' and 'StandardScaler

algorithm - Alpha Beta 搜索和换位表

检查连接四个字段的算法

javascript - JQuery-输入值没有改变?

python - 如何很好地处理 [ :-0] slicing?

python - 如何在 Python 中拆分和解析字符串?

python - 在python中按用户计算并发 session

javascript - 如何在 html 输入中创建多级对象?

jquery - 如何使用 jquery 触发 <input type ="file"> 元素