Commit bfa40292 by BellCodeEditor

auto save

parent ce20da48
Showing with 63 additions and 11 deletions
if player==computer: # #方法一
print("平局") # a,b,c = input('输入内容').split()
elif player=="石头"and computer=="剪刀": # A=int(a)
print("恭喜,你赢了") # B=int(b)
elif player=="剪刀"and computer=="布" # C=int(c)
print("恭喜,你赢了) # print((A+B)*C)
elif player==""and computer=="石头": # # 方法二
print("恭喜你,你赢了") # a,b,c =map(int,input('输入内容').split())
else: # print((a+b)*c)
print("很遗憾,你输了")
\ No newline at end of file
# 问题描述
# 输入 A B 输出结果A+B
# 输入的第一行包括两个整数,空格隔开,分别表示A,B
# 输出一行,包括A+B这个表达公式,也包括答案
# 例子
# 3 6
# 结果
# 3+6=9
# 问题描述
# 将这个数列从小到大排序,1<=n<=200
# 输入格式
# 输入一些数字,从小到大排序,空格隔开
# 输出格式
# 输出一行,按从小到大的顺序排序后的数列
# 例子
# 5 8 4 7 1
# 结果
# 1 4 5 7 8
#第一种方法 冒泡排序
def mao(num_list):
num = len(num_list) #控制循环次数
for i in range(num): # 7 9 2 5
for j in range(num-1-i):
if a[j] > a[j+1] :
a[j],a[j+1] = a[j+1],a[j]
a = list(map(int,input().split()))
mao(a)
print(a)
#第二种方法
# a = list(map(int,input().split()))
# a.sort()
# print(a)
# sort()函数:应用于列表,意思是排序
\ 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