[백준] 10869 - 사칙연산
알고리즘/백준2023. 10. 13. 00:07[백준] 10869 - 사칙연산

• 문제 사칙연산과 나머지연산을 각각 개행하여 출력하는 프로그램문제이다. • 풀이 먼저 A와 B에 입력값을 받는다. 이 때 예제 출력을 보면 알 수 있듯이 나눗셈연산을 할 때 소수점은 고려하지않는다. 즉, 모든 변수의 타입은 int타입으로 선언한다. 또한 값을 출력한 뒤 개행이 있으므로 println()메서드를 사용한다. import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int A = sc.nextInt(); int B = sc.nextInt(); System.out.println(A+B); System.out.println(A-B);..

image