def jjfrist():
for i in range(1, 10):
for j in range(1, i + 1):
print("%d*%d=%d\t" % (i, j, i * j), end="")
print()
def jjsecond():
i = 1
while i < 10:
j = 1
while j <= i:
print("%s*%s=%s\t" % (i, j, i * j), end="")
j += 1
print()
i += 1
if __name__ == '__main__':
jjfrist()
jjsecond()
def sxhfrist():
for a in range(1, 10):
for b in range(10):
for c in range(10):
s = a * a * a + b * b * b + c * c * c
if s == a * 100 + b * 10 + c:
print(a, b, c)
print(s)
def sxhsecond():
for i in range(100, 1000):
p = i // 100
q = (i // 10) % 10
w = i % 10
if i == p * p * p + q * q * q + w * w * w:
print(i)
if __name__ == '__main__':
sxhfrist()
sxhsecond()
def tqfrist():
for i in range(100):
if i % 7 != 0 and i != 7 and i % 10 != 7 and i // 10 != 7:
print(i)
if __name__ == '__main__':
tqfrist()
def bqbjfrist():
for i in range(21):
for j in range(34):
for k in range(100):
if i + j + k == 100 and i * 5 + j * 3 + k // 3 == 100 and k % 3 == 0:
print(i, j, k)
def bqbjsecond():
for ggj in range(21):
for mmj in range(34):
xxj = 100 - ggj - mmj
if ggj * 5 + mmj * 3 + xxj // 3 == 100 and xxj % 3 == 0:
print(ggj, mmj, xxj)
if __name__ == '__main__':
bqbjfrist()
bqbjsecond()
def bubbule_sort(alist):
for i in range(len(alist)):
for j in range(0, len(alist) - i - 1):
if alist[j] >= alist[j + 1]:
alist[j], alist[j + 1] = alist[j + 1], alist[j]
print(alist)
if __name__ == '__main__':
alist = [90, 23, 46, 74, 23, 4, 54, 23, 45, 23, 51, 22, 3, 5]
bubbule_sort(alist)