package abc;
import java.util.*;
public class Aa {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println("welcome to the game");
System.out.println("if you guess the number and you will win!");
System.out.println("let's start!");
Random rd=new Random();
int number=rd.nextInt(10);
int sum=0;
while(true){
Scanner sc=new Scanner(System.in);
int s=sc.nextInt();
sum+=1;
if(s==number){
System.out.println("congrations,you were right!");
System.out.println("你在第"+sum+"次答对了");
break;
}
else{
System.out.println("sorry,please keep trying!");}
}
}
}