Last updated 2 years ago
Was this helpful?
#設定初值 n = 10000 #迴圈測試 while (True): #條件成立才離開迴圈 if n%17==1 and n%23==2 and n%37==3: break #改變變數值 n+=1 #印出結果 print(n)
10881
請用while迴圈找到比10000大的3個數,這3個數的總和最小,而且這3個數都有以下特性:它的每個數字之和等於15。例如,數字12345,它的每個數字之和=1+2+3+4+5 = 15。