赞
踩
# coding:utf-8
deg = input()
def F(C):
#*请在此添加代码,将摄氏度deg转换为华氏度*#
#********** Begin *********#
f=int(C)*(9.0/5)+32#*9.0才可以*#
return f
#********** End *********#
print ("%.2f"%(F(deg)))
# coding:utf-8 counter = 0 def access(): #请在此添加代码,实现counter的调用,每次调用counter的值加1 #********** Begin *********# global counter counter+=1 return counter #********** End **********# for i in range(5): access() print (counter)
# coding:utf-8 from math import sqrt a = float(input()); b = float(input()); c = float(input()) def roots(a,b,c): #请在此添加代码,求方程 ax^2+bx+c = 0的解,返回由方程根构成的列表,若方程有无数解,返回['inf'] #********** Begin *********# if (b**2-4*a*c)<0: return ['inf'] else: x1=((-b)+sqrt(b**2-4*a*c))/(2*a) x2=((-b)-sqrt(b**2-4*a*c))/(2*a) if x1==x2: return [x1] else: return [x1,x2] #********** End **********# print (roots(a,b,c))
# coding:utf-8 from math import sqrt a=float(input()); b=float(input()); c=float(input()) def roots(a, b, c): #请在此添加代码,在a不等于0的情况下编写函数求解方程的两个根并将根返回 #********** Begin *********# if (b**2-4*a*c)<0: return ['inf'] else: x1=((-b)+sqrt(b**2-4*a*c))/(2*a) x2=((-b)-sqrt(b**2-4*a*c))/(2*a) return (x1,x2) #********** End **********# if a != 0: print (roots(a,b,c))
# coding:utf-8 from math import * delX = 0.001 x = float(input()) b=x def diff(f): #请在此添加代码,求出函数f的导数 #********** Begin *********# global b# global delX a=lambda b,delX:( (sin(b+delX) - sin(b-delX) ))*1.000/(2.0*delX) return a(b,delX) #********** End *********# print("%.2f"%(diff(sin(x))))
# coding:utf-8 from math import * delX = 0.01#与之前有些许不同,坑die x = float(input()) b=x def diff(f): #请在此添加代码,求出函数f的导数 #********** Begin *********# global b# global delX a=lambda b,delX:( (sin(b+delX) - sin(b-delX) ))*1.000/(2.0*delX) return a(b,delX) #********** End *********# print("%.6f"%(diff(sin(x))))
# coding:utf-8 import random from functools import reduce n = input() # useless n = random.randint(5,10) L = [] for i in range(n): L.append(random.randint(1,n)) def sum_of_paras(*arg): #请在此添加代码,返回参数列表 arg 中所有数的和 #********** Begin *********# sum=0 for i in arg: sum+=i return sum #********** End *********# strcall = "sum_of_paras("; strcall += reduce(lambda x, y: x+","+y, [str(s) for s in L]) strcall +=")" if eval(strcall) == sum(L): print("Y") else: print("N")
# coding:utf-8 Lst = input() Lst = Lst.split(',') def abs_sum(L): #请在此添加代码,以递归的方式设计函数abs_sum(L)返回列表L(假设其中全是整数)中所有整数绝对值之和 #********** Begin *********# sum = 0 for i in L: i = int(i) if i>=0: sum=sum+i continue else: sum=sum+(-1)*i return sum #********** End *********# print(abs_sum(Lst))
# coding:utf-8 from math import sqrt def Vieta(i): #请在此输入代码 #********** Begin *********# if i==0: return sqrt(2)/2 else: return sqrt(2+2*Vieta(i-1))/2 #********** End *********# N = int(input()) v = Vieta(0); p = 1.0 for i in range(N+1): #请在此输入代码 #********** Begin *********# p=p*Vieta(i) #********** End *********# print ("%.6f"%(2.0/p))
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。