# !/usr/bin/env python
# -*- coding: utf-8 -*-
# 據說係菜鳥,程序員,大師,神人 四個等級寫出代碼的區別...
import math as m
#
for i in range(100000):
x = int(m.sqrt(i + 100))
y = int(m.sqrt(i + 268))
if(x * x == i + 100) and (y * y == i + 268):
print (i)
#
print([i for i in range(100000)
if int(m.sqrt(i + 100))**2 == i + 100
and int(m.sqrt(i + 268))**2 == i + 268 ])
#
print(list(filter(
lambda i:(int(m.sqrt(i + 100))**2 == i + 100
and int(m.sqrt(i + 268))**2 == i + 268),
range(100000))))
#
print([21, 261, 1581])
时间: 2024-10-09 17:04:43