摘要: 阅读全文
posted @ 2020-05-06 15:57 liuchun玲 阅读(99) 评论(0) 推荐(0) 编辑
摘要: def jumpFloor(number): if number == 1 or number == 2: return number n, m = 1, 2 for i in range(number-2): result = m + n n, m = m, result return resul 阅读全文
posted @ 2020-04-29 16:12 liuchun玲 阅读(90) 评论(0) 推荐(0) 编辑
摘要: import math def distance(n,m,l): d = math.sqrt(n**2+m**2+l**2) return d x,y,z=input().split(",") d=distance(float(x),float(y),float(z)) print("{:.2f}" 阅读全文
posted @ 2020-04-29 16:11 liuchun玲 阅读(911) 评论(0) 推荐(0) 编辑
摘要: def isPrime(n): if n==2: return True else: for i in range(2,n+1): if n%i==0: return False else: return True num=int(input()) if isPrime(num): print("y 阅读全文
posted @ 2020-04-29 16:10 liuchun玲 阅读(121) 评论(0) 推荐(0) 编辑
摘要: class Solution(object): def romanToInt(self, s): sum=0 convert={'M': 1000,'D': 500 ,'C': 100,'L': 50,'X': 10,'V': 5,'I': 1} for i in range(len(s)-1): 阅读全文
posted @ 2020-04-29 16:08 liuchun玲 阅读(336) 评论(0) 推荐(0) 编辑
摘要: n=str(input("")) m=n[::-1] if n[0]!="-": print(int(m)) elif n[0]=="-": print("-",end="") print(int(m[:-1])) 阅读全文
posted @ 2020-04-22 15:46 liuchun玲 阅读(277) 评论(0) 推荐(0) 编辑
摘要: A=input() if A[0] in ['U','u']: RMB=(eval(A[3:]))*6.78 print("RMB{:.2f}".format(RMB)) else: USD=(eval(A[3:]))/6.78 print("USD{:.2f}".format(USD)) 阅读全文
posted @ 2020-04-22 15:34 liuchun玲 阅读(104) 评论(0) 推荐(0) 编辑
摘要: from random import random def printIntro(): #打印程序介绍信息 print("19信计1班23号刘春玲进行比赛分析结果:") print("这个程序模拟两个选手A和B的某种竞技比赛") print("程序运行需要A和B的能力值(以0到1之间的小数表示)") 阅读全文
posted @ 2020-04-19 22:15 liuchun玲 阅读(102) 评论(0) 推荐(0) 编辑
摘要: import jieba txt=open("C:/Users/25764/Desktop/jieba1.txt","r",encoding=("utf-8")).read() words=jieba.lcut(txt) counts = {} for word in words: if len(w 阅读全文
posted @ 2020-04-13 15:53 liuchun玲 阅读(105) 评论(0) 推荐(0) 编辑
摘要: a=eval(input()) n=eval(input()) m=0 sum=0 for i in range(1,n+1): m=m*10+2 sum+=m print("{}".format(sum)) 阅读全文
posted @ 2020-03-28 22:44 liuchun玲 阅读(105) 评论(0) 推荐(0) 编辑