标签:
1 import java.util.Scanner; 2 3 public class Solution 4 { 5 public static void main(String[] args) 6 { 7 Scanner input = new Scanner(System.in); 8 9 System.out.println("Please guess the coin, 0 for negative and 1 for positive: "); 10 int number = input.nextInt(); 11 12 input.close(); 13 14 int judgment = (int)(Math.random() * 101); 15 16 if(judgment <= 50) 17 judgment = 0; 18 else 19 judgment = 1; 20 21 if(number == judgment) 22 System.out.println("True"); 23 else 24 System.out.println("False"); 25 } 26 }
标签:
原文地址:http://www.cnblogs.com/wood-python/p/5764358.html