Last active
September 28, 2022 12:24
-
-
Save ulimy/8dc24c38e316f59ab0ed920bd1bf1727 to your computer and use it in GitHub Desktop.
저는 아리입니당^~^
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class Main { | |
public static void main(String[] args) throws Exception { | |
System.out.println(isSameNumber(input(), random())); | |
} | |
private static int input() { | |
Scanner sc = new Scanner(System.in); | |
return sc.nextInt(); | |
} | |
private static int random() { | |
return (int)(Math.random() * 10) + 1; | |
} | |
private static boolean isSameNumber(int input, int random) { | |
return input == random; | |
} | |
} | |
==================== | |
assertThat(isSameNumber(1,1)).isTrue(); | |
assertThat(isSameNumber(1,5)).isFalse(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment