[프로그래머스/Java] Lv.0 덧셈식 출력하기

febCho·2024년 2월 28일
0

코딩테스트

목록 보기
6/253
post-thumbnail

문제

두 정수 a, b가 주어질 때 다음과 같은 형태의 계산식을 출력하는 코드를 작성해 보세요.
a + b = c

- 제한사항

  • 1 ≤ a, b ≤ 100

풀이

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();

        System.out.println(a + " + " + b + " = " + (a+b));
    }
}

결과

결과

profile
Done is better than perfect.

0개의 댓글