Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
47460 陈宣霖 数字之和 Python3 Accepted 34 MS 3776 KB 223 2023-04-30 14:36:49

Tests(1/1):


Code:

def f(s): r=0 for i in range(0,len(s)): r+=int(s[i]) return r while True: n=int(input()) if n==0: break r1=f(str(n)) r2=f(str(n*n)) print(str(r1)+" "+str(r2))