Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package cc.openhome;
- import java.util.Scanner;
- public class main {
- public static void main(String[] args) {
- Scanner com=new Scanner(System.in);
- int num;
- int number=(int)(Math.random()*10);
- do{
- System.out.printf("please input a number\n");
- num=com.nextInt();
- }while(num!=number);
- System.out.printf("猜對了");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement