This repository was archived by the owner on Aug 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
3주차 과제입니다. #72
Open
shchoblue
wants to merge
1
commit into
SoongSilComputingClub:shchoblue
Choose a base branch
from
shchoblue:main
base: shchoblue
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
3주차 과제입니다. #72
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| import java.util.ArrayList; | ||
| import java.util.Scanner; | ||
|
|
||
| public class SsccJava3 { | ||
| public static void main(String[] args) { | ||
| Scanner scanner = new Scanner(System.in); | ||
| /*String name = scanner.nextLine(); | ||
| int count = scanner.nextInt(); | ||
|
|
||
| System.out.println(name); | ||
| System.out.println(count);*/ | ||
|
|
||
| System.out.println("자동차의 개수를 입력하세요."); | ||
| int count = scanner.nextInt(); | ||
| //int carSpeed; | ||
| //String carName; | ||
| ArrayList carSpeed = new ArrayList(); | ||
| ArrayList<String> carName = new ArrayList<>(); | ||
|
|
||
| for (int i = 1; i <= count; i++) { | ||
| System.out.println(i + "번째 자동차의 스피드를 입력하세요."); | ||
| int speed = scanner.nextInt(); | ||
| scanner.nextLine(); | ||
| System.out.println(i + "번째 자동차의 이름을 입력하세요."); | ||
| String name = scanner.nextLine(); | ||
| carSpeed.add(speed); | ||
| carName.add(name); | ||
| } | ||
|
|
||
| scanner.close(); | ||
|
|
||
| System.out.println("\n-----경기 참가자 소개-----"); | ||
| for (int i = 1; i <= count; i++) { | ||
| System.out.println("스피드는 " + carSpeed.get(i-1) + "이고, 이름은 " + carName.get(i-1) + "입니다."); | ||
| } | ||
| } | ||
| } | ||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Car의 정보들(이름, 스피드 등등...)을 담을 수 있는 Car 클래스를 정의하여 코드를 다시 작성해주세요.