本帖最后由 ilvsoft 于 2014-4-7 18:37 编辑
do
{
check1=scanner1.nextInt();
if(check1==1)
fish=1;
else if(check1==2)
dog=1;
else if(check1==3)
cat=1;
else if(check1==-1)
fish=0;
else if(check1==-2)
dog=0;
else
cat=0;
if(cat==1)
System.out.println(cat);
if(dog==1)
System.out.println(dog);
if(fish==1)
System.out.println(fish);
}while(dog==1&&fish==1&&cat==1||cat==1&&fish==1&&dog==0||dog==1&&cat==1&&fish==0);
-----------------------------------------------------------------------------------------------------------//dog fish cat 都是int型初始化为0
|