package price;
import java.util.Scanner;
public class Yuan {
public static void main(String[] args){
Scanner input=new Scanner(System.in);
int j=(int) (Math.random()*100);
int i,k;
System.out.println("请输入商品的价格%d"); //i是输入的价格;//j是商品价格
for(k=0;k<10;k++)
{
i=input.nextInt();
if(j==i)
{
System.out.printf("猜对了,商品的价格是%d",i);
break;
}
else if(i>j)
{
System.out.printf("高了,重新输入:\n");
}
else if(i<j)
{
System.out.printf("低了,重新输入:\n");
}
if(k>=10)
{
System.out.printf("商品的价格是:%d",j);
}
}
// TODO Auto-generated method stub
}
}