0分还是好难qwq
  • 板块B2002 Hello,World!
  • 楼主QAQ5
  • 当前回复2
  • 已保存回复2
  • 发布时间2024/7/20 18:49
  • 上次更新2024/7/20 20:09:35
查看原帖
0分还是好难qwq
749028
QAQ5楼主2024/7/20 18:49

最后一个字母错了QAQ

# 输出Hello,World!
def codeShowStr(codes):
    for c in codes[:-1]:
        print(chr(c),end='')
    print(chr(c))
    return
def charIsNum(char):
    _1_ = ord('0')
    _2_ = ord('9')
    charCode = ord(char)
    if _1_ <= charCode <= _2_:
        return True
    else:
        return False
def strShowString(str):
    if str == '':
        print()
    cutLeft = 0
    cutRight = cutLeft + 1
    result = []
    while True:
        while cutRight < len(str) and charIsNum(str[cutRight]):
            cutRight += 1
        result.append(int(str[cutLeft:cutRight]))
        if not cutRight < len(str):
            break
        cutLeft = cutRight + 1
        while cutLeft < len(str) and not charIsNum(str[cutLeft]):
            cutLeft += 1
        if not cutLeft < len(str):
            break
        cutRight = cutLeft + 1
    codeShowStr(result)
strShowString("72 101 108 108 111 44 87 111 114 108 100 33")
2024/7/20 18:49
加载中...