题目:
思路:
讨论区看到的,变量base取余(i * i % base === i)就用的很巧妙,学习一下
提交:
let line
while (line = Number(readline())) {
let base = 10
let count = 0
for (let i = 0; i <= line; i++) {
if (i === base) {
base *= 10
}
if (i * i % base === i) {
count++
}
}
console.log(count)
}