본문 바로가기

알고리즘/백준39

[Python/Java] 백준 10869번 - 사칙연산 https://www.acmicpc.net/problem/10869 10869번: 사칙연산 두 자연수 A와 B가 주어진다. 이때, A+B, A-B, A*B, A/B(몫), A%B(나머지)를 출력하는 프로그램을 작성하시오. www.acmicpc.net Python a, b = map(int, input().split()) print(a+b, a-b, a*b, a//b, a%b, sep='\n') Java import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); String[] s = scan.nextLine().split(" "); int .. 2020. 6. 8.
[Python/Java] 백준 1008번 - A/B https://www.acmicpc.net/problem/1008 1008번: A/B 두 정수 A와 B를 입력받은 다음, A/B를 출력하는 프로그램을 작성하시오. www.acmicpc.net Python a, b = map(int, input().split()) print(a/b) Java import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); String[] s = scan.nextLine().split(" "); double n1 = Integer.parseInt(s[0]); double n2 = Integer.parseInt(s[1.. 2020. 6. 8.
[Python/Java] 백준 10998번 - A×B https://www.acmicpc.net/problem/10998 10998번: A×B 두 정수 A와 B를 입력받은 다음, A×B를 출력하는 프로그램을 작성하시오. www.acmicpc.net Python a, b = map(int, input().split()) print(a * b) Java import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); String[] s = scan.nextLine().split(" "); int n1 = Integer.parseInt(s[0]); int n2 = Integer.parseInt(s[1]).. 2020. 6. 8.
[Python/Java] 백준 1001번 - A-B https://www.acmicpc.net/problem/1001 1001번: A-B 두 정수 A와 B를 입력받은 다음, A-B를 출력하는 프로그램을 작성하시오. www.acmicpc.net Python a, b = map(int, input().split()) print(a - b) Java import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); String[] s = scan.nextLine().split(" "); int n1 = Integer.parseInt(s[0]); int n2 = Integer.parseInt(s[1]); .. 2020. 6. 8.
[Python/Java] 백준 1000번 - A+B https://www.acmicpc.net/problem/1000 1000번: A+B 문제 두 정수 A와 B를 입력받은 다음, A+B를 출력하는 프로그램을 작성하시오. 입력 첫째 줄에 A와 B가 주어진다. (0 < A, B < 10) 출력 첫째 줄에 A+B를 출력한다. 예제 입력 1 복사 1 2 예제 출력 1 복사 www.acmicpc.net Python a, b = map(int, input().split()) print(a+b) Java import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); String[] s = scan.nextL.. 2020. 6. 8.