-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMax3.java
More file actions
20 lines (15 loc) · 506 Bytes
/
Max3.java
File metadata and controls
20 lines (15 loc) · 506 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package chap01;
import java.util.Scanner;
public class Max3 {
public static void main(String[] args) {
Scanner stdIn = new Scanner(System.in);
System.out.println("세 정수의 최댓값을 구합니다.");
System.out.print("a의 값 : "); int a = stdIn.nextInt();
System.out.print("b의 값 : "); int b = stdIn.nextInt();
System.out.print("c의 값 : "); int c = stdIn.nextInt();
int max = a;
if ( b > max ) max = b;
if ( c > max ) max = c;
System.out.println("최댓값은 "+max+"입니다.");
}
}