- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGreetUser.java
More file actions
Latest commit
21 lines (16 loc) · 675 Bytes
/
Copy pathGreetUser.java
File metadata and controls
21 lines (16 loc) · 675 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
packageweek01.basic;
importjava.util.Scanner;
publicclassGreetUser {
publicstaticvoidmain(String[] args) {
System.out.println("<이름 입력 받고 인사하기>");
// 2단계(기초): 이름 입력받고 인사하기
// 문제: 사용자로부터 이름을 입력받아 "안녕하세요,[이름]님!"
// 과 같이 인사하는 메시지를 출력하는 프로그램을 작성하세요.
// 힌트: 출력, 변수, input
Scannerscanner = newScanner(System.in);
System.out.println("이름을 입력하세요.>");
Stringname = scanner.nextLine();
System.out.println("안녕하세요, "+name+"님!");
scanner.close();
}
}