4 5963256679666554089

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

# KCPC 1

c = input()
if c in ["a", "e", "i", "o", "u"]:
print("vowel")
else:
print("consonant")

# KCPC 2
h, w = map(int, input().split())
imageRows = []
for i in range(h):
imageRows.append(input())
for line in imageRows:
print(line)
print(line)

# KCPC 3 -- Dreamer --
s = input()
list = ["eraser", "erase", "dreamer", "dream"]
for word in list:
s = s.replace(word, "")
if len(s) == 0:
print("YES")
else:
print("NO")

# KCPC 4 -- f91 --
while True:
n = int(input())
if n == 0:
break
res = 91
if n > 100:
res = n - 10
print("f91(%d) = %d" % (n, res))
# KCPC 5 -- Reversed num --
def rev(s):
revStr = ""
for c in s:
revStr = c + revStr
return int(revStr)

n = int(input())
for _ in range(n):
a, b = map(str, input().split())
result = rev(a) + rev(b)
print(int(rev(str(result))))

# KCPC 6 -- Hay Points --


a, b = map(int, input().split())
hayDic = {}
for _ in range(a):
w, s = map(str, input().split())
hayDic[w] = int(s)

keys = hayDic.keys()
for _ in range(b):
salary = 0
line = input()
while line != ".":
words = line.split(" ")
for word in words:
if word in keys:
salary += hayDic[word]
line = input()
print(salary)

You might also like