Commit f0a99aa3 by BellCodeEditor

auto save

parent 3fc4e625
Showing with 32 additions and 2 deletions
x=5
y=3
z=1/3
for i in range(1,101):
for j in range(1,101):
for k in range(1,101):
if x*i+y*j+z*k==100 and i+j+k==100:
print(i,j,k)
=777 class Hero:
print() def __init__(self, name, hp, attack):
self.level = 1
self.name = name # name:名字
self.hp= hp
self.attack= attack # attack:攻击
def upgrade(self):
self.level=self.level+1
self.hp = self.hp + 50
self.attack = self.attack + 4
houyi = Hero("后羿",240,23)
houyi.upgrade()
print("等级为:",houyi.level)
print("血量为:",houyi.hp)
print("攻击力为:",houyi.attack)
\ No newline at end of file
《算经》中有一道很有趣的数学题:
鸡翁一值钱五,鸡母一值钱三,鸡雏三值钱一。
百钱买百鸡,问鸡翁、鸡母、鸡雏各几何?
(公鸡,母鸡,小鸡都必须要有)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment