[Programmers_CT] 26. 덧셈식 출력하기

문정준's avatar
Mar 21, 2025
[Programmers_CT] 26. 덧셈식 출력하기
 
💡
프로그래머스 코딩 테스트 24. 덧셈식 출력하기

1. 문제 설명

notion image
 

제한 사항

notion image

2. 입출력 예시

notion image

3. 코드 작성

import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int b = sc.nextInt(); int result = a + b; System.out.println(a + " + " + b + " = " + result); } }
✏️

정해진 양식에 맞추어 출력

  • a + b의 결과를 result로 저장하고, 출력 양식에 맞게 텍스트 작성
    • System.out.println(a + " + " + b + " = " + result);

4. 테스트 실행

notion image

5. 제출 후 채점

notion image
Share article

sxias