Language_Coder 514 : 입력 - 자가진단6

boom.jun.cho·2022년 3월 14일
0

Language_Coder_JUNGOL

목록 보기
19/197

문제

키를 입력받아 출력하는 프로그램을 작성하라.
(입력할때 "height = " 문장을 먼저 출력하고 키를 입력 받아야 합니다.)

출력

Your height is 170cm.

코드

package com.jungol.algorithm019;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
    	Scanner scanner = new Scanner(System.in);
    	
    	System.out.print("height = ");
    	int height = scanner.nextInt();
    	
    	System.out.print("Your height is " + height + "cm.");
    	
    	scanner.close();
    }
}
profile
하루하루 최선을

0개의 댓글