QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#167279#6407. Classical A+B ProblemrealIyxiang#Compile Error//C++14695b2023-09-07 13:23:082023-09-07 13:23:08

Judging History

你现在查看的是最新测评结果

  • [2023-09-07 13:23:08]
  • 评测
  • [2023-09-07 13:23:08]
  • 提交

answer

T = int(input())

def check(x):
    if x <= 0:
        return False
    s = str(x)
    for i in s:
        if i != s[0]:
            return False
    return True

def gener(x, len):
    return int(str(x) * len)

while T > 0:
    T -= 1
    s = input()
    lens = len(s)
    x = int(s)
    ok = 0
    for i in range(1, 10):
        if check(x - gener(i, lens)):
            ok = True
            t = gener(i, lens)
            print(t, x - t)
            break
    if ok :
        continue
    for i in range(1, 10):
        if check(x - gener(i, lens - 1)):
            ok = True
            t = gener(i, lens - 1)
            print(t, x - t)
            break

Details

answer.code:1:1: error: ‘T’ does not name a type
    1 | T = int(input())
      | ^