Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 4 additions & 17 deletions upDown.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,11 @@

public class upDown {
public static void main(String[] args) {

int answer = (int)(Math.random() * 100 + 1);
int guess;
int count = 0;
Scanner scan = new Scanner(System.in);

do {
System.out.print("정답을 추측하여 보세요 : ");
guess = scan.nextInt();
count++;

if(guess > answer)
System.out.println("다운!");
if(guess < answer)
System.out.println("업!");
} while(guess != answer);

System.out.println("축하합니다. 시도 횟수는 " + count + " 번 입니다.");
System.out.println("updown");
System.out.println("updown2");
System.out.println("updown3");

}

}