전체 글51 [백준] 5622 다이얼 (파이썬/python) 🎈문제 https://www.acmicpc.net/problem/5622 🎁어떤 알고리즘? 1. 단순 구현! 💻코드 word = input() alphabet = ['ABC','DEF','GHI','JKL','MNO','PQRS','TUV','WXYZ'] time = 0 for i in range(len(word)): for j in alphabet: if word[i] in j: time += alphabet.index(j) + 3 print(time) 2023. 6. 19. [백준] 1546 평균 (파이썬/python) 🎈문제 https://www.acmicpc.net/problem/1546 🎁어떤 알고리즘? 1. 단순 구현! 💻코드 N = int(input()) grade = list(map(int,input().split())) M = max(grade) average = 0 for i in range(len(grade)): new_grade = grade[i]/M*100# python은 나누기 연산자로 나누면 float형이 됨 average += new_grade/len(grade) print(average) 2023. 6. 19. [백준] 10818 최소,최대 (파이썬/python) 🎈문제 https://www.acmicpc.net/problem/10818 🎁어떤 알고리즘? 1. 단순 구현! 💻코드 n = int(input()) arr = list(map(int,input().split())) print(f.'{min(arr)} {max(arr)}') 2023. 6. 19. [백준] 10961 A+B-4 (파이썬/python) 🎈문제 https://www.acmicpc.net/problem/10951 🎁어떤 알고리즘? 1. 단순 구현! 💻코드 while True: try: a,b = map(int,input().split()) except: break print(a+b) 2023. 6. 19. 이전 1 ··· 7 8 9 10 11 12 13 다음