![[백준 알고리즘] 2675번 문자열 반복(Python 3, Java)](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FctoKb3%2FbtqBW04dOue%2FY7R1EGBRahB1aiSXmkukv1%2Fimg.png)
n = int(input()) for i in range(n): P, S = input().split() for j in range(len(S)): print(S[j]*int(P), end='') print() import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in));..
![[백준 알고리즘] 10809번 알파벳 찾기(Python 3, Java)](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FYaUZD%2FbtqBWC3u7Fw%2FZD4xUmXgkubrnrE95yJWp1%2Fimg.png)
word = input() alpha = [-1 for _ in range(26)] for i in range(len(word)): if alpha[ord(word[i]) - 97] == -1: alpha[ord(word[i]) - 97] = i else: pass print(" ".join(map(str, alpha))) import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; public class Main { public static void main(String[] args) throws IOException { BufferedReader br ..
![[백준 알고리즘] 11654번 아스키 코드(Python 3, Java)](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FmsmZK%2FbtqBXWtpQ5u%2FKaU3Neo58RNwXbh0H3uKKK%2Fimg.png)
ch = input() print(ord(ch[0])) import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int a = br.readLine().charAt(0); System.out.println(a); } } ▼링크 https://www.acmicpc.net/problem/11654 11654번: 아스키 코드 알파벳..
![[백준 알고리즘] 15596번 정수 N개의 합(Python3, Java)](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FoOy6M%2FbtqBTKVKpde%2F2t6Tvn2qwMejWkXygbXQk0%2Fimg.png)
def solve(a): ans = 0 for i in range(len(a)): ans += a[i] return ans public class Test { long sum(int[] a) { long ans = 0; for(int i:a) ans += i; return ans; } } ▼링크 https://www.acmicpc.net/problem/15596 15596번: 정수 N개의 합 정수 n개가 주어졌을 때, n개의 합을 구하는 함수를 작성하시오. 작성해야 하는 함수는 다음과 같다. C, C11, C (Clang), C11 (Clang): long long sum(int *a, int n); a: 합을 구해야 하는 정수 n개가 저장되어 있는 www.acmicpc.net
![[백준 알고리즘] 2577번 숫자의 개수(Python 3, Java)](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FB31c8%2FbtqBS6dDDlu%2FEkFXOK2B48V9lCr03VUmB0%2Fimg.png)
a = int(input()) b = int(input()) c = int(input()) list = [0 for _ in range(10)] mul = str(a * b * c) for i in range(len(mul)): list[int(mul[i])] += 1 for i in list: print(i) import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputSt..
![[백준 알고리즘] 2562번 최댓값(Python 3, Java)](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbcWuLb%2FbtqBWrHpUNB%2FctORUBoSfakiUGIqWvEKF1%2Fimg.png)
a = list() for i in range(9): a.append(int(input())) print(max(a), a.index(max(a))+1) import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int max = 0; int max_idx = 0; for(int i=0; imax){ max = num; max_..
![[백준 알고리즘] 10818번 최소, 최대(Python3, Java)](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fb8qtRR%2FbtqBUUjhoJh%2FKnRbCb2TyegtyBOH50zZs1%2Fimg.png)
n = int(input()) a = list(map(int,input().split())) min, max = a[0], a[0] for i in range(n): if a[i] max: max = a[i] print(min, max) 출처: https://hwiyong.tistory.com/217 Case = int(input()) num_list = list(map(int, input().split())) print('{} {}'.format(min(num_list), max(num_list))) 문자열 대괄호 자리에 format 뒤의 괄호안에 있는 값을 하나씩 넣어 출력한다. import java.io.BufferedReader; import ja..
![[백준 알고리즘] 1110번 더하기 사이클(Python3, Java)](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FIMxcG%2FbtqBS7cAClb%2FzDAePCG4kuvomEKeokUOW0%2Fimg.png)
n = nn = int(input()) cycle = 0 while True: res = (n // 10) + (n % 10) cycle += 1 n = int(str(n % 10) + str(res % 10)) if nn == n: break print(cycle) import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); i..
![[백준 알고리즘] 10951번 A+B - 4(Python3, Java)](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FcfgJmi%2FbtqBRw4LMrU%2F9pk6o9QVLCHAzz0NglOQ31%2Fimg.png)
import sys try: while True: line = sys.stdin.readline() a, b = line.split() print(int(a) + int(b)) except: exit() 입력 개수를 모르기 때문에 try except를 사용하였다. import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new ..
![[백준 알고리즘] 10952번 A+B - 5(Python3, Java)](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FPJKdD%2FbtqBUA6fWjP%2FK4YK43CC4zLiktiofKsnbk%2Fimg.png)
import sys while(1): line = sys.stdin.readline() a, b = line.split() if a == '0' and b == '0': break print(int(a)+int(b)) import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); while(true){ String[] line = ..