펀치머신
작성자 정보
- 작성자 최고관리자
- 작성일
컨텐츠 정보
- 조회 973
본문
				가장 고득점자를 찾는 프로그램을 만드시오. 
			
					
public class Punch {
    public static void main(String[] args) {
        String[] names = { "Elena", "Thomas", "Hamilton", "Suzie", "Phil",
                           "Matt", "Alex", "Emma", "John", "James",
                           "Emily","Daniel", "Neda", "Aaron", "Kate" };
        int[] scores = {590, 252, 562, 251, 519,
                        408, 870, 646, 185, 620,
                        577, 633, 937, 380, 285};
        int highScoreIdx = 0;
        for (int i = 0; i < scores.length; i++)
            if (scores[highScoreIdx] < scores[i])
                highScoreIdx = i;
        System.out.println("최고득점자는 " + names[highScoreIdx] + " 입니다.");
    }
}
관련자료
- 
			이전
- 
			다음
			댓글 0개
					
			
				등록된 댓글이 없습니다.
			
					