Skip to content

Instantly share code, notes, and snippets.

@ulimy
Last active September 28, 2022 12:24
Show Gist options
  • Save ulimy/8dc24c38e316f59ab0ed920bd1bf1727 to your computer and use it in GitHub Desktop.
Save ulimy/8dc24c38e316f59ab0ed920bd1bf1727 to your computer and use it in GitHub Desktop.
저는 아리입니당^~^
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