上一页 1 2 3 4 5 6 ··· 16 下一页
摘要: s="Python语言简单易学" print(s.encode("utf-8")) 阅读全文
posted @ 2025-01-02 20:39 Grit_Doyle 阅读(16) 评论(0) 推荐(0)
摘要: #求奇数分之一序列前N项和N=int(input())S=0t=1for i in range(N): S+=1/(t) t+=2print("sum = {:.6f}".format(S)) 阅读全文
posted @ 2025-01-02 20:39 Grit_Doyle 阅读(27) 评论(0) 推荐(0)
摘要: #求交错序列前N项和N=int(input())S=0t=1for i in range(N): if i%2==0: S=S+(i+1)/(t) t=(t+2) else: S=S-(i+1)/(t) t=(t+2)print("{:.3f}".format(S)) 阅读全文
posted @ 2025-01-02 20:38 Grit_Doyle 阅读(16) 评论(0) 推荐(0)
摘要: #阶梯电价e=float(input())cost=0if e<0: print("Invalid Value!")elif e<=50: cost=e*0.53 print("cost = {0:.2f}".format(cost))else: cost=50*0.53+(e-50)*0.58 p 阅读全文
posted @ 2025-01-02 20:38 Grit_Doyle 阅读(23) 评论(0) 推荐(0)
摘要: #计算分段函数[1]x=float(input())if x==0: y=0else: y=1/xprint("f({0:.1f}) = {1:.1f}".format(x,y)) 阅读全文
posted @ 2025-01-02 20:37 Grit_Doyle 阅读(23) 评论(0) 推荐(0)
摘要: #计算 11+12+13+...+mm=int(input())sum=0for i in range(11,m+1): sum+=iprint("sum =",sum) 阅读全文
posted @ 2025-01-02 20:37 Grit_Doyle 阅读(31) 评论(0) 推荐(0)
摘要: #从键盘输入三个数到a,b,c中,按公式值输出a,b,c=input().split()a=int(a)b=int(b)c=int(c)print(b*b-4*a*c) 阅读全文
posted @ 2025-01-02 20:37 Grit_Doyle 阅读(52) 评论(0) 推荐(0)
摘要: A=int(input())B=int(input())print(A+B) 阅读全文
posted @ 2025-01-02 20:36 Grit_Doyle 阅读(59) 评论(0) 推荐(0)
摘要: #产生每位数字相同的n位数A,B=input().split(",")A=A.strip()B=int(B.strip())print(int(A*B)) 阅读全文
posted @ 2025-01-02 20:36 Grit_Doyle 阅读(13) 评论(0) 推荐(0)
摘要: #比较大小print(*sorted(map(int,input().split())),sep="->") 阅读全文
posted @ 2025-01-02 20:35 Grit_Doyle 阅读(18) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 ··· 16 下一页