首页 > TAG信息列表 > 罗逸凡

括号配对测试 20信计一班罗逸凡

stra = input("")x = 0z = 0y = 0for i in stra: if i == '(': x = x + 1 elif i == ')': if x >= 0: x = x - 1 else : print("配对不成功")if x != 0: print("配对不成功"

凯撒密码 信计一班罗逸凡

x = input()for i in range(0,len(x)): if x[i] == ' ': print(' ',end="") elif x[i] in ['x','y','z']: print(chr(ord(x[i]) - 23),end="") else : print(chr(ord(x

同符号运算 信计一班罗逸凡

z = int(input()) m = abs(z)a = m + 10b = m - 10c = m * 10if (z>0): a = abs(a) b = abs(b) c = abs(c)else: a = -abs(a) b = -abs(b) c = -abs(c)print(z,a,b,c)    学号:37

格式化输出 信计一班罗逸凡

x1 = float(input("输入一个数:"))x2 = round(x1,3)x_str = str(x2)print("格式化该数并保留三位小数:{}".format(x2))      学号:37