[백준 알고리즘] 10818번 최소, 최대(Python3, Java)
언어, 알고리즘 공부/백준2020. 2. 11. 23:05[백준 알고리즘] 10818번 최소, 최대(Python3, Java)

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)
언어, 알고리즘 공부/백준2020. 2. 11. 22:43[백준 알고리즘] 1110번 더하기 사이클(Python3, Java)

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)
언어, 알고리즘 공부/백준2020. 2. 11. 18:10[백준 알고리즘] 10951번 A+B - 4(Python3, Java)

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)
언어, 알고리즘 공부/백준2020. 2. 11. 18:02[백준 알고리즘] 10952번 A+B - 5(Python3, Java)

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 = ..

[백준 알고리즘] 11022번  A+B - 8(Python3, Java)
언어, 알고리즘 공부/백준2020. 2. 11. 17:53[백준 알고리즘] 11022번 A+B - 8(Python3, Java)

import sys n = int(sys.stdin.readline()) for i in range(1, n+1): line = sys.stdin.readline() a, b = line.split() print("Case #%d: %d + %d = %d" %(i, int(a), int(b), int(a)+int(b))) import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class b_11022 { public static void main(String[] args) throws IOException { Buffere..

[백준 알고리즘] 11021번  A+B - 7(Python3, Java)
언어, 알고리즘 공부/백준2020. 2. 11. 17:47[백준 알고리즘] 11021번 A+B - 7(Python3, Java)

import sys n = int(sys.stdin.readline()) for i in range(1, n+1): line = sys.stdin.readline() a, b = line.split() print("Case #%d: %d" %(i,int(a)+int(b))) import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class b_11021 { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedRe..

[백준 알고리즘] 1552번 빠른 A+B(Python3, Java)
언어, 알고리즘 공부/백준2020. 2. 11. 17:31[백준 알고리즘] 1552번 빠른 A+B(Python3, Java)

import sys n = sys.stdin.readline() n= int(n) for i in range(n): line= sys.stdin.readline() a,b = line.split() print(int(a)+int(b)) import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class b_15552 { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamRe..

[백준 알고리즘] 10950번 A+B-3 (Python3, Java)
언어, 알고리즘 공부/백준2020. 2. 11. 17:20[백준 알고리즘] 10950번 A+B-3 (Python3, Java)

n = int(input()) for i in range(n): a,b = input().split() print(int(a)+int(b)) import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class b_10950 { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int T = Integer.parseInt(br.readLin..

[백준 알고리즘] 2884번 알람 시계(Python3, Java)
언어, 알고리즘 공부/백준2020. 2. 11. 17:10[백준 알고리즘] 2884번 알람 시계(Python3, Java)

h, m = input().split() h, m = int(h), int(m) if m0: h -= 1 else: #h==0인경우 h = 23 m = 60-(45-m) else: m = m-45 print(h, m) import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class b_2884 { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System..

[백준알고리즘] 2753번 윤년(Python3, Java)
카테고리 없음2020. 2. 11. 17:01[백준알고리즘] 2753번 윤년(Python3, Java)

year = int(input()) if (year%4 == 0 and year%100 != 0) or year%400 ==0: print(1) else: print(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 year = Integer.parseInt(br.readLine()); if(((year%4..

image