반응형

Prob


Approach

upper() : 대문자로

 


Code

q = input()
q = q.upper()
q = list(q)
cnt = [0] * 26
for i in range(ord('Z') - ord('A') + 1):
    cnt[i] = q.count(chr(ord('A') + i))

if cnt.count(max(cnt)) > 1:
    print("?")
else : 
    print(chr(ord('A') + cnt.index(max(cnt))))

 

출처

https://www.acmicpc.net/problem/1157

반응형
블로그 이미지

Refrin

일상생활 끄적 IT 프로젝트 끄적

반응형

Prob


Approach

기본 문법


Code

s = int(input())
for i in range(s):
    aws = ""
    iter, m_str = list(input().split())
    for j in range(len(m_str)):
        aws = aws + (m_str[j] * int(iter))
    print(aws)

 

출처

https://www.acmicpc.net/problem/2675

반응형
블로그 이미지

Refrin

일상생활 끄적 IT 프로젝트 끄적

반응형

Prob


Approach

a ~ z 저장하는 배열 만들어서 index 찾기


Code

s = input()
m_str = ""
for i in range(ord("z") - ord("a") + 1):
    try:
        idx = s.index(chr(ord("a") + i))
    except:
        idx = -1
        
    m_str = m_str + str(idx) + " "

print(m_str)

 

출처

https://www.acmicpc.net/problem/10809

반응형

'프로젝트 > Baekjoon' 카테고리의 다른 글

BAEKJOON PYTHON 1157 단어 공부  (0) 2021.08.20
BAEKJOON PYTHON 2675 문자열 반복  (0) 2021.08.20
BAEKJOON PYTHON 11720 숫자의 합  (0) 2021.08.20
BAEKJOON PYTHON 11654 아스키 코드  (0) 2021.08.20
BAEKJOON PYTHON 1065 한수  (0) 2021.08.20
블로그 이미지

Refrin

일상생활 끄적 IT 프로젝트 끄적