Open
Conversation
Author
|
마지막에 파일 날려서 늦었습니다. |
taejinn
reviewed
Apr 6, 2026
| printWinners(cars, distances); | ||
| } | ||
|
|
||
| private static String[] inputCarList(){ |
There was a problem hiding this comment.
이 메서드는 입력받기, 문자열 분리, 중복 검사, 이름 검증까지 함께 담당하고 있는 것으로 보입니다! 메서드를 조금 더 나누면 각 메서드의 역할이 더 분명해져서 읽기 좋아질 것 같습니다!!
| String carName = Console.readLine(); //이름 입력받기 | ||
| String[] names = carName.split(",", -1); //쉼표 구분 | ||
|
|
||
| for (int i = 0; i < names.length; i++) { //이름 중북 불가능 |
There was a problem hiding this comment.
이 아래 부분은 for문 안에 또 다른 for문과 if문이 들어가 있어서, 인덴트 depth 제한을 한 번 다시 확인해보시면 좋을 것 같습니다! 1주차 요구사항과 함께 보면 이 부분은 조금 더 단순하게 나눠볼 수 있을 것 같습니다!!
|
|
||
| System.out.print("최종 우승자 : "); | ||
| boolean first = true; //우승자 중 맨앞 | ||
| for (int i = 0; i < cars.length; i++) { //최대거리로 우승자 찾기 |
There was a problem hiding this comment.
우승자 출력 부분도 조건이 여러 단계로 들어가 있어서 depth가 깊어지는 느낌입니다! 출력 로직을 조금 분리해주시면 더 깔끔하게 보일 것 같습니다!!
| public class Application { | ||
| public static void main(String[] args) { | ||
| // TODO: 프로그램 구현 | ||
| String[] cars = inputCarList(); |
There was a problem hiding this comment.
main()에서 전체 흐름을 입력 → 진행 → 우승자 출력 순서로 나누어 둔 점은 좋았습니다! 처음 구현에서도 프로그램 흐름이 한눈에 들어오도록 정리한 점이 좋아 보입니다!!
|
|
||
| public class Application { | ||
| public static void main(String[] args) { | ||
| // TODO: 프로그램 구현 |
There was a problem hiding this comment.
이미 구현이 완료된 상태라면 이 주석은 이제 역할이 거의 없어 보입니다! 제출 전에 이런 기본 TODO 주석은 정리해두시면 코드가 더 깔끔해질 것 같습니다!!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.