목록입문 (85)
안경잡이 구루루
![](http://i1.daumcdn.net/thumb/C150x150.fwebp.q85/?fname=https://blog.kakaocdn.net/dn/dI4IIY/btqFoB0EqUH/5i0gAtaFiPSKR7CU4MBkTk/img.png)
나: #include int main() { float score[1000],high=0,total=0; int N; scanf("%d", &N); for (int i = 0; i < N; i++) { scanf("%f", &score[i]); if (high < score[i]) high = score[i]; } for (int j = 0; j < N; j++) { score[j] = score[j] / high * 100.0; total += score[j]; } printf("%f", total /N); return 0; } 완성된 코드는 위와 같다. flaot 형태로 저장하지 않으면 출력할 때 이상한 값(0.0) 이 나와서 이것 때문에 푸느라 오래걸렸다. #include int main() { f..
![](http://i1.daumcdn.net/thumb/C150x150.fwebp.q85/?fname=https://blog.kakaocdn.net/dn/QDJXo/btqFnjAedcW/4nkagm630VHv1ugwY63IAk/img.png)
https://www.acmicpc.net/problem/1152 나: sentence = input() word = sentence.split() print(len(word)) 완성된 코드는 위와 같다. sentence라는 변수에 입력값을 받는다. 이때 단어는 빈칸을 기준으로 나눠 지는 것이기 때문에 split()을 이용해서 나눠서 word라는 새로운 변수에 리스트 형태로 각 단어들이 저장된다. 그리고 이 리스트의 길이를 구하고 출력하면 쉽게 문제를 풀 수 있다. 결록은 파이썬 짱짱맨
![](http://i1.daumcdn.net/thumb/C150x150.fwebp.q85/?fname=https://blog.kakaocdn.net/dn/64UU6/btqFoBzr55I/4BpOt7nTdAC06IFj0pwMM1/img.png)
https://www.acmicpc.net/problem/1157 나: word = input() ws = word.lower() a = sorted(set(ws)) alpha= [] high = 0 ouput = 0 for i in a: if ws.count(i) >= high: high = ws.count(i) alpha.append(high) output = i else: pass if alpha.count(max(alpha)) >= 2: print('?') else: print(output.upper()) 완성된 코드는 위와 같다. word = input() ws = word.lower() a = sorted(set(ws)) alpha= [] high = 0 ouput = 0 대소문자로 이루어진 ..
![](http://i1.daumcdn.net/thumb/C150x150.fwebp.q85/?fname=https://blog.kakaocdn.net/dn/ZuECo/btqFmuWg4kK/KMLIvKqciACDksdegkDRP0/img.png)
https://www.acmicpc.net/problem/2675 나: T = int(input()) for i in range(T): R,S = input().split() s='' for i in range(len(S)): s += S[i]*int(R) print(s) 완성된 코드는 위와 같다. T = int(input()) for i in range(T): R,S = input().split() s='' 테스트 케이스를 결정하는 변수 T에 입력값을 받는다. 그 입력값 만큼 반복문 For을 통해서 반복횟수 R과, 문자열 S를 받는다. 이때 반복으로 새롭게 만들어진 문자열이 들어갈 변수 s 를 문자열을 더할 수 있도록 ''로 초기화 시켰다. for i in range(len(S)): s += S[i]*..