자료구조와 알고리즘 입문16 Chapter 01-1. 기본 알고리즘_알고리즘이란? 세 값의 최댓값 구하기 package ch01_1; import java.util.Scanner; // 3개의 정숫값 입력하고 최댓값 출력하기 public class Ex01_max3 { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int a = scan.nextInt(); int b = scan.nextInt(); int c = scan.nextInt(); int max = a; if (b > max) max = b; if (c > max) max = c; System.out.println("최댓값 => " + max); } } 세 값의 최댓값 구하는 메서드 만들기 package ch01_1; // 3개의.. 2023. 11. 19. 이전 1 2 3 4 다음