![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
浙大oj
不关我事~
没什么好说的
展开
-
第2章-9 比较大小 (10分)
浙大oj-浙大版《Python 程序设计》题目集# @Time : 2020/10/9 19:39# @Author : Yurken# @File : 比较大小.pya=[0]*3a[0],a[1],a[2]=map(int, input().split())a=sorted(a)print(a[0],end='->')print(a[1],end='->')print(a[2])原创 2020-10-11 16:34:34 · 166 阅读 · 0 评论 -
第2章-8 转换函数使用 (30分)
浙大oj-浙大版《Python 程序设计》题目集# @Time : 2020/10/9 19:29# @Author : Yurken# @File : 其他进制转换为10进制.pya=input()b,c=a.split(',')c=int(c)print(int(b,c))原创 2020-10-10 21:41:08 · 142 阅读 · 0 评论 -
第2章-7 产生每位数字相同的n位数 (30分)
浙大oj-浙大版《Python 程序设计》题目集# @Time : 2020/10/4 16:49# @Author : Yurken# @File : 产生每位数字相同的n位数.pys = input()c=[]a,b = s.split(',')a=int(a)b=int(b)for i in range(0,b): print(a,end='')原创 2020-10-09 21:12:36 · 143 阅读 · 0 评论 -
第2章-6 求交错序列前N项和 (15分)
浙大oj-浙大版《Python 程序设计》题目集# @Time : 2020/10/4 16:44# @Author : Yurken# @File : 求交错序列前N项和.pyn = int(input())b = int(2*n)a = 0c=0for i in range(1, b,2): a += (-1)** c*(c+1)/ i c+=1print('%.3f' % a)...原创 2020-10-09 21:11:26 · 84 阅读 · 0 评论 -
第2章-5 求奇数分之一序列前N项和 (15分)
浙大oj-浙大版《Python 程序设计》题目集# @Time : 2020/10/4 16:14# @Author : Yurken# @File : 求奇数分之一序列前N项和.pyn = int(input())b = int(2*n)a = 0for i in range(1, b,2): a += 1 / iprint('sum = %.6f' % a)# N = int(input())# factor = list(range(1,2*N+1,2))#前N项,而不是原创 2020-10-09 21:10:19 · 153 阅读 · 0 评论 -
第2章-4 特殊a串数列求和 (20分)
浙大oj-浙大版《Python 程序设计》题目集# @Time : 2020/10/4 15:01# @Author : Yurken# @File : 特殊a串数列求和.py# a,n=map(int, input().split())# if 0<a<=9 and 0<n<=9:# b=[]# c=0# for i in range(1,n+1):# c=a*i# b.append(c)# d=原创 2020-10-09 21:08:58 · 209 阅读 · 0 评论 -
第2章-3 阶梯电价 (15分)
浙大oj-浙大版《Python 程序设计》题目集# @Time : 2020/10/4 14:48# @Author : Yurken# @File : 阶梯电价.pyx = float(input())if 0<= x <= 50: y = 0.53*x print("cost = {0:.2f}".format(y))elif x>50: y = 26.5+0.58*(x-50) print("cost = {0:.2f}".format(原创 2020-10-09 21:07:28 · 303 阅读 · 0 评论 -
第2章-2 计算分段函数[1] (10分)
浙大oj-浙大版《Python 程序设计》题目集# @Time : 2020/10/4 14:20# @Author : Yurken# @File : 计算分段函数(1).pyx = float(input())if x == 0: y = 0else: y = 1 / xprint("f({0:.1f}) = {1:.1f}".format(x, y))# x = input()# x = float(x)# a= str(x)# if x==0:# pr原创 2020-10-09 21:06:14 · 748 阅读 · 0 评论 -
第2章-1 计算 11+12+13+...+m (30分)
浙大oj-浙大版《Python 程序设计》题目集a = int(input())b = 0for i in range(11, a + 1): b += iprint('sum =', b)原创 2020-10-09 21:04:46 · 137 阅读 · 0 评论 -
第1章-2 从键盘输入三个数到a,b,c中,按公式值输出 (30分)
浙大oj-浙大版《Python 程序设计》题目集a, b, c = map (int,input().split())d = b * b - 4 * a * cprint(d)原创 2020-10-09 21:00:10 · 337 阅读 · 0 评论 -
第1章-1 从键盘输入两个数,求它们的和并输出 (30分)
浙大oj-浙大版《Python 程序设计》题目集a = input()a=int (a)b = input()b=int (b)c=a+bprint(c)原创 2020-10-09 20:58:14 · 423 阅读 · 0 评论