``` public class olimpic { public static void main(String[] args) { Country[] countries = new Country[10]; // 10개를 만들어준다. countries[0] = new Country("노르웨이", 10, 9 , 8); countries[1] = new Country("독일", 9, 5 , 4); countries[2] = new Country("네덜란드", 6, 5 , 2); countries[3] = new Country("캐나다", 5, 5 , 6); countries[4] = new Country("매국", 5, 3 , 2); for(int i =0; i< 20; i++) { int randomIndex =(int)(Math.random() * 10); countries[randomIndex].gold++; int randomIndex1 =(int)(Math.random() * 10); countries[randomIndex1].silver++; int randomIndex3 =(int)(Math.random() * 10); countries[randomIndex3].bronze++; } } } class Country{ // 나리 이름, 메달의 종류 String name; int gold; int silver; int bronze; private int total; // 기본 생성자를 만든다. public Country(String name, int gold, int silver, int bronze) { this.name = name; this.gold = gold; this.silver = silver; this.bronze = bronze; } @Override public String toString() { return String.format("%s : %d + % d + %d + %d", name , gold , silver , bronze , total); } } ``` 초보자 인데 우선 너무 헷갈리고 어떻게 풀러가야 할지 모르겠네용 ㅠㅠ
# 답변입니다 이번주 중 내로 문제 아래쪽에 따라하기 식의 가이드라인을 만들어 놓도록 할게요~~ 질문 ㄱㅅㄱㅅ! # PS 휴가중이라 답변이 늦었네요. 좋은 하루 보내세요~
# 답변입니다. 해당 문제에 대한 모범 답안을 아래 링크를 통해 확인해 보셔요~ http://cloudstudying.kr/codes/536 # PS 별표문제라 많이 어려웠으리라 예상되네요. 초보자 입장에서 어려운게 당연 한 거에요~ 힘을 내셔요 화이팅!