【入门2】分支结构https://www.luogu.com.cn/training/101#problemsP5710 【深基3.例2】数的性质
n = int(input())
if (n % 2 == 0) and (n <= 12 and n > 4):
a = 1
else:
a = 0
if (n % 2 == 0) or (n <= 12 and n > 4):
b = 1
else:
b = 0
if b == 1:
d = 0
else:
d = 1
c = 0
if (b == 1) and (a != 1):
c = 1
else:
c = 0
print(a, b, c, d)
n = int(input())
ans = 0
if n % 4 == 0:
if n % 100 == 0:
if n % 400 == 0:
ans = 1
else:
ans = 1
print(ans)
n = int(input())
if n == 0:
print("Today, I ate 0 apple.")
elif n == 1:
print("Today, I ate 1 apple.")
else:
print("Today, I ate %d apples."%n)
n = int(input())
bt = 5 * n
lt = 11 + 3 * n
if bt < lt:
print("Local")
else:
print("Luogu")
m, h = map(float, input().split())
bmi = float(m / h / h)
if bmi < 18.5:
print("Underweight")
elif bmi >= 18.5 and bmi < 24:
print("Normal")
else:
print("%.6g"%bmi)
print("Overweight")
a = [int(i) for i in input().split()]
a.sort()
for i in range(2):
print(a[i], end=' ')
print(a[2])
def check(n):
ans = 0
if n % 4 == 0:
if n % 100 == 0:
if n % 400 == 0:
ans = 1
else:
ans = 1
return ans
year, mon = map(int, input().split())
rn = [31,29,31,30,31,30,31,31,30,31,30,31]
fn = [31,28,31,30,31,30,31,31,30,31,30,31]
if check(year) == 1:
print(rn[mon-1])
else:
print(fn[mon-1])
a = []
for i in range(7):
x, y = map(int, input().split())
a.append(x+y)
maxx = 8
day = 0
for i in range(7):
if(maxx < a[i]):
maxx = a[i]
day = i+1
print(day)
n = int(input())
ans = 9999999999999
for i in range(3):
x, y = map(int, input().split())
cnt = int(n // x)
if n % x != 0:
cnt += 1
ans = min(ans, cnt * y)
print(ans)
import sys
s = input().strip()
num = []
ls = len(s)
for i in range(ls-1):
if s[i] >= '0' and s[i] <='9':
num.append(eval(s[i]))
sum = int(0)
l = len(num)
for i in range(l):
sum += (i+1) * num[i]
sum %= 11
if(s[ls-1] == 'X' and sum == 10):
print("Right")
sys.exit(0)
#if s[ls-1] == 'X'
if str(sum) == s[ls-1]:
print("Right")
else:
t = s[0:ls-1]
if sum == 10:
t += 'X'
else:
t += str(sum)
print(t)
n = int(input())
if n <= 150:
sum = n * 0.4463
elif n > 150 and n <= 400:
sum = 150 * 0.4463 + (n - 150) * 0.4663
else:
sum = 150 * 0.4463 + 250 * 0.4663 + (n - 400) * 0.5663
print("%.1f"%sum)
a, n = map(int, input().split())
cnt = int(n // 7)
ans = cnt * (250 * 5)
x = n % 7
if a == 6:
if x > 2:
ans += (x - 2) * 250
elif a == 7:
if x == 1:
ans += 0
elif x > 1 and x < 6:
ans += (x - 1) *250
elif x == 6:
ans += 5 * 250
else:
if x != 0:
if a + x == 6:
ans += x * 250
elif a + x == 7:
ans += (x - 1) * 250
elif a + x > 7:
ans += (x - 2) * 250
else:
ans += x * 250
print(ans)
import math
a = [int(i) for i in input().split()]
a.sort()
x = math.gcd(a[0], a[2])
print(int(a[0]/x), end='')
print("/", end="")
print(int(a[2]/x), end="")
a = [int(i) for i in input().split()]
h = int(input())
h += 30
cnt = 0
for i in a:
if(h >= i):
cnt += 1
print(cnt)
a = [int(i) for i in input().split()]
a.sort()
if a[0] + a[1] <= a[2] | a[2] - a[1] >= a[0]:
print("Not triangle")
elif a[0] * a[0] + a[1] * a[1] == a[2] * a[2]:
print("Right triangle")
if a[0] == a[1]:
print("Isosceles triangle")
elif a[0] * a[0] + a[1] * a[1] > a[2] * a[2]:
print("Acute triangle")
if a[0] == a[1]:
print("Isosceles triangle")
if a[1] == a[2]:
print("Equilateral triangle")
else:
print("Obtuse triangle")
if a[0] == a[1]:
print("Isosceles triangle")
a = [int(i) for i in input().split()]
s = input().strip()
a.sort()
if s[0] == 'A':
if s[1] == 'B':
print("%d %d %d"%(a[0], a[1], a[2]))
else:
print("%d %d %d"%(a[0], a[2], a[1]))
elif s[0] == 'B':
if s[1] == 'A':
print("%d %d %d" % (a[1], a[0], a[2]))
else:
print("%d %d %d" % (a[1], a[2], a[0]))
else:
if s[1] == 'A':
print("%d %d %d"%(a[2], a[0], a[1]))
else:
print("%d %d %d"%(a[2], a[1], a[0]))