首页 > 解决方案 > 如何在 SPOJ 问题硬币中接受 Python 输入?

问题描述

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

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

标签: pythonalgorithminputimplementation

解决方案


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
    ...

推荐阅读