参考答案(个人编写)
A
a, b = map(int, input().split( ))
c = int(input())
print(c - a + b)
B
a = float(input())
print("%.2lf" %(a * 9 / 5 + 32))
C
a = float(input())
if a > 3:
a = int(a)
print(((a + 1 - 3) * 2 + 10))
else:
print(10)
D
a = input()
b = list(a)
b.sort(reverse=True)
ans = int(''.join(b))
print(ans)
E
a, b, c = input().split()
a = int(a)
b = int(b)
c = str(c)
if c == '+':
print(a + b)
elif c == '-':
print(a - b)
elif c == '*':
print(a * b)
elif c == '//':
if b == 0:
print("Error")
else:
print(a // b)
elif c == '%':
print(a % b)
else:
print("Error")
F
a = str(input())
b = a[0]
if b == 'A':
print('Hangzhou')
elif b == 'B':
print('Ningbo')
elif b == 'C':
print('Wenzhou')
elif b == 'E':
print('Huzhou')
elif b == 'F':
print('Jiaxing')
elif b == 'G':
print('Jinhua')
elif b == 'H':
print('Quzhou')
elif b == 'I':
print('Taizhou')
elif b == 'J':
print('Taizhou')
elif b == 'K':
print('Zhoushan')
elif b == 'L':
print('Lishui')
else:
print('Input error')
G
a = list(input())
b = len(a) // 2 + len(a) % 2
c = a[:b]
d = a[b - len(a) % 2:len(a)]
d.reverse()
# print(b, c, d)
print("Yes" if c == d else "No")
H
a,b,c=input().split()
a=int(a)
b=int(b)
c=int(c)
a%=b
p=0
ans=""
n=a
while(p<c):
n%=b
n*=10
ans+=str(n//b)
p+=1
print(ans)
I
a = list(map(float, (input().split(','))))
ssum = sum(a)
a.sort()
print("%.2lf %.2lf"%(ssum / len(a), a[0]))
J
print(__import__('datetime').datetime.strptime(input(),'%Y-%m-%d').timetuple().tm_yday)
K
def is_perfect_number(n):
m = 1
for i in range(2, int(n ** 0.5) + 1):
if n % i == 0:
m += i + n // i
return m == n
n = int(input())
for n in range(2, n+1):
if is_perfect_number(n):
print(n)
L
n = int(input())
for i in range(1, n+1):
b = ""
for j in range(1, i+1):
b += str(j)
for j in range(i-1, 0, -1):
b += str(j)
print(" " * (n-i) + b)
M
n = int(input())
is_prime = [True] * (n+1)
is_prime[0] = is_prime[1] = False
for i in range(2, n+1):
if is_prime[i]:
for j in range(i*i, n+1, i):
is_prime[j] = False
ans = sum(1 for x in is_prime if x)
print(ans)
N
a, n = map(int, input().split())
b = 0
for i in range(1, n + 1):
b = b + int(str(a)*i)
print(b)
O
m = int(input())
for i in range(m):
s = input()
sum = 0
if any(c.isupper() for c in s):
sum += 1
if any(c.islower() for c in s):
sum += 1
if any(c.isdigit() for c in s):
sum += 1
if any(c in ['~', '!', '@', '#', '$', '%', '^'] for c in s):
sum += 1
if len(s) >= 8 and len(s) <= 16 and sum >= 3:
print('YES')
else:
print('NO')
标签:elif,int,高一,range,2023.5,input,print,素养,sum
From: https://www.cnblogs.com/EraYes/p/17429540.html