Head vs breakz
[code] - 백준 문자열 11654,11720,10809,2675,1157,1152,2908,5622,2941,1316번 python 본문
Head/Code
[code] - 백준 문자열 11654,11720,10809,2675,1157,1152,2908,5622,2941,1316번 python
headbreakz 2020. 4. 4. 16:2811654
#문자열
#11654
a = input()
print(ord(a))
11720
#11720
a = int(input())
b = list(str(input()))
e = 0
for i in range(a):
d = int(b[i])
e += d
print(e)
10809
#10809
a = list(str(input()))
b = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
c = [-1 for j in range(len(b))]
for i in range(len(a)):
if c[b.index(a[i])] == -1 :
c[b.index(a[i])] = i
for i in range(len(c)):
print(c[i],end = " ")
2675
#2675
a = int(input())
for i in range(a):
b = list(map(str,input().split()))
c = list(b[1])
d = ''
for j in range(len(c)):
d += c[j]*int(b[0])
print(d)
1157
#1157
a = str(input())
b = list(a.upper())
c = list(set(b))
d = []
if len(b) == 1 :
print(a.upper())
else :
for i in range(len(c)):
d.append(b.count(c[i]))
e = sorted(d)
if e[len(c)-1] == e[len(c)-2] :
print("?")
else :
print(c[d.index(max(d))])
1152
#1152
a = list(input().split())
print(len(a))
2908
#2908
a =list(map(int,input().split()))
c = ((a[0]%10)*100)+(((a[0]%100)-(a[0]%10)))+(a[0]//100)
d = ((a[1]%10)*100)+(((a[1]%100)-(a[1]%10)))+(a[1]//100)
if c > d :
print(c)
elif c < d :
print(d)
5622
#5622
a = list(str(input()))
b = 0
for i in range(len(a)):
if a[i] =='A' or a[i] == 'B' or a[i] == 'C':
b +=2
elif a[i] =='D' or a[i] == 'E' or a[i] == 'F':
b +=3
elif a[i] =='G' or a[i] == 'H' or a[i] == 'I':
b +=4
elif a[i] =='J' or a[i] == 'K' or a[i] == 'L':
b +=5
elif a[i] =='N' or a[i] == 'M' or a[i] == 'O':
b +=6
elif a[i] =='P' or a[i] == 'Q' or a[i] == 'R' or a[i] =='S':
b +=7
elif a[i] =='T' or a[i] == 'U' or a[i] == 'V':
b +=8
elif a[i] =='W' or a[i] == 'X' or a[i] == 'Y' or a[i] =='Z':
b +=9
print(b+len(a))
2941
#2941
a = input()
b = ['c=','c-','dz=','d-','lj','nj','s=','z=']
for i in b :
a = a.replace(i,'*')
print(len(a))
#1316
a = int(input())
count = 0
for i in range(a):
b = list(str(input()))
c = []
c.append(b[0])
if len(b) == 1 :
pass
else :
for j in range(len(b)-1):
if b[j] != b[j+1] :
c.append(b[j+1])
if len(c) == len(set(c)):
count+=1
print(count)
'Head > Code' 카테고리의 다른 글
[code] - OpenCV GrabCut (0) | 2020.04.16 |
---|---|
[code] - 백준 수학 1193,2869,10250,2775,1712,2839,2292 python (0) | 2020.04.08 |
[code] - 백준 함수 15596,4673,1065번 python (0) | 2020.04.03 |
[code] - 백준 1차열배열 10818,2582,2577,3053,1546,8958,4344 python (0) | 2020.04.03 |
[code] - 백준 실습1 10039,5543,10817,2523,2446,10996, python (0) | 2020.03.19 |
Comments