line = input().split() print(len(line)) 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)); StringTokenizer st = new StringTokenizer(br.readLine(), " "); System.out.prin..
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));..
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 ..
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번: 아스키 코드 알파벳..
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
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..
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_..
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..
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..
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 ..