目录
- result = num = int(input())
-
- for z in range(11, num):
- result += z
-
- print("sum = %d" % result)
- N = int(input()) + 1
- print("sum = " + str(sum([x for x in range(11, N)])))
- x = float(input())
- result = 0 if x == 0 else 1 / x
- print("f(%.1f) = %.1f" % (x, result))
- figure = float(input())
- result = 0.53*figure if figure<=50 else 26.5+(figure-50)*0.58
-
- if figure>0 :
- print("cost = %.2f"%(result))
- else :
- print("Invalid Value!")
- N = int(input())
- result = 1.0
- for z in range(1,N):
- result += 1.0 / (z * 2 + 1)
- print("sum = %.6f" % result)
- N = int(input()) * 2
- print("sum = %.6f" % sum([1 / x for x in range(1, N, 2)]))
- N = int(input())
- result = flag = 1.0
-
- for z in range(2,N+1):
- flag = -flag
- result += flag * z / (z*2-1)
-
- print("%.3f" % result)
- N = int(input()) + 1
- print("%.3f" % sum([x / (x * 2 - 1) if x % 2 == 1 else -x / (x * 2 - 1) for x in range(1, N)]))
- N,M = map(int,input().split(','))
- for z in range(0,M):
- print("%d" % N,end='')
- N, M = map(int, input().split(','))
- print(sum([N * (10 ** x) for x in range(0, M)]))
- num, flag = map(int, input().split(','))
- result = 0
- op = 1
-
- while num > 0:
- result += num % 10 * op
- op *= flag
- num //= 10
-
- print("%.f"%result)
- a, b, c = map(int, input().split())
- if a > b: (a, b) = (b, a)
- if a > c: (a, c) = (c, a)
- if b > c: (b, c) = (c, b)
-
- print("%d->%d->%d" % (a, b, c))
- a, b = map(int, input().split())
-
- if a > b or b > 100:
- print('Invalid.')
- else:
- print('fahr celsius')
- while a <= b:
- print("%d%6.1f" % (a, 5.0 * (a - 32) / 9))
- a += 2
- a, b = map(int, input().split())
- result = 0.0
- for index in range(a, b + 1):
- result += index * index + 1 / index
-
- print("sum = %.6f" % result)
- N, M = map(int, input().split())
- print("sum = %.6f" % sum([x*x+1/x for x in range(N,M+1)]))
- a, b = map(int, input().split())
- result = op = a*10+a
-
- for index in range(2, b, 2):
- op = op*100+a*10+a
- result += op
-
- print(result)
- A, N = map(int, input().split())
- print(sum([sum([A * (10 ** y) for y in range(x)]) for x in range(2, N + 1, 2)]))
- import math
-
- a, b, c = map(int, input().split())
- if a + b > c and a + c > b and b + c > a:
- s = (a + b + c) / 2.0
- area = math.sqrt(s * (s - a) * (s - b) * (s - c))
- print("area = %.2f; perimeter = %.2f" % (area, a+b+c))
-
- else:
- print("These sides do not correspond to a valid triangle")
- x = float(input())
- y = 4*x/3 if x<=15 else 2.5*x-17.5
- print("%.2f"%y)
- head, tail = map(int, input().split())
- result = flag = 0 # 结果 and 判断换行
-
- for index in range(head, tail + 1):
- if flag % 5 == 0 and flag>0: print()
- flag += 1
- result += index
- print("%5d" % index, end='')
-
- print("\nSum = %d" % result)