Skip to content

Conversation

@io-uty
Copy link

@io-uty io-uty commented Jul 7, 2024

  1. 상대방 숫자 -> 정수형으로 랜덤 숫자를 받아 저장한 후 문자열로 변환한 후 배열에 한글자씩 넣는다.
  2. 내가 입력한 숫자 -> 마찬가지로 정수형으로 숫자를 받아 저장한 후 문자열로 변환, 배열에 한글자씩 넣는다.
  3. 상대방 숫자와 내가 입력한 숫자를 한자리씩 비교한다.

@genius00hwan
Copy link
Collaborator

야구게임에 필요한 기능들을 생각하면서 어떤 객체를 만들 수 있는 지 생각해보고 클래스를 분리해보세요~~

int[] arr = new int[3];
arr[0] = in/100;
arr[1] = (in%100)/10;
arr[2] = in%10;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

String str;
str.charAt()함수를 활용하는 방법을 생각해보세요

public static void main(String[] args) {
// TODO: 프로그램 구현
{
Scanner input = new Scanner(System.in);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

제공한 Console.readline()을 활용해주세요

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants