[Java Algorithm] 프로그래머스 Lv.0 _ 덧셈식 출력하기
·
Algorithm Study
👿 문제 👿 두 정수 a, b 가 주어질 때 다음과 같은 형태의 계산식을 출력하는 코드를 작성해보세요 a + b = c [Algorithm] 1. 연산자를 문자열로 표현 2. System.out.printf 사용해서 표현 [Code] import java.util.Scanner; public class Solution1 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int b = sc.nextInt(); int c = a+b; System.out.println(a + " + " + b + " = " + c ); } } public class Solution2 { publ..