如何在SPOJ问题COINS中使用Python输入?

问题描述 投票:1回答:1

谁能帮助我如何获取下面问题中描述的输入(链接提供)。我只是想知道Python 3.7语言中输入部分的实现。请不要分享您的主要问题的答案或逻辑。

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

python algorithm input implementation
1个回答
2
投票
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
    ...
© www.soinside.com 2019 - 2024. All rights reserved.