입력 한 가장 낮은 점수를 인쇄하려면이 코드가 필요하며 여기 몇 시간 동안 앉아 있고 그것을 수행하는 방법을 알 수 없습니다. 배열을 사용하고 있지만 루프를 사용해야합니다. 힌트가 있습니까?for 루프를 사용하여 입력 한 가장 낮은 점수를 찾으려면 어떻게합니까?
예 출력 :
How many scores? 3
Enter score 1: 90
Enter score 2: 80
Enter score 3: 100
Lowest score is 80
내 코드 :
int score,numScore,count;
Scanner keyboard = new Scanner(System.in);
System.out.print("How many scores? ");
numScore = keyboard.nextInt();
for(count = 1; count <= numScore; count++){
System.out.print("Enter score " + count + ":");
score = keyboard.nextInt();
}
적어도, 사용하는 언어를 알려주는 것이 도움이 될지 모르겠습니다. –
자바입니다. 죄송합니다. – user3003920
이 질문에 대한 대답은 이미 있습니다 [답변] (http://stackoverflow.com/questions/19435242/getting-the-lowest-and-highest-value-from-integers-without-using-arrays) – eatSleepCode