import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.println("Please guess the coin, 0 for negative and 1 for positive: "); int number = input.nextInt(); input.close(); int judgment = (int)(Math.random() * 101); if(judgment <= 50) judgment = 0; else judgment = 1; if(number == judgment) System.out.println("True"); else System.out.println("False"); } }
相关文章
- 11-13HW3.14