距離上次更新已有 1174 天,文章內容可能已過時。題目 a059: 完全平方和https://zerojudge.tw/ShowProblem?problemid=a059 解答 python123456789101112s = [1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 256, 289, 324, 361, 400, 441, 484, 529, 576,625, 676, 729, 784, 841, 900, 961]for i in range(int(input())): n = int(input()) m = int(input()) x = 0 for j in s: if n<=j<=m: x += j print('Case',str(i+1)+':',x)