Commit b9442751 by 大雄

第二次作业

parent 9a2ed127
# 石头与宝石
Jewels = input("请输入宝石的类型\n")
Stones = input("请输入具有的石头为\n")
count = 0
for i in range(len(Jewels)):
for j in range(len(Stones)):
if Jewels[i] == Stones[j]:
count += 1
print("\n")
str = '%d' % count # 将数字转化成字符串
print('石头中具有的宝石数目为' + str) # 如何换行后再输出count
print('---------------')
\ 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 to comment