import java.util.*;
public class Main{
public static void main(String[] args) {
Scanner in=new Scanner(System.in);
int target=0;
int count=1;
for(int i=6;i>=0;i--){
target^=1<<i;
if(target>100){
target^=1<<i;
continue;
}
if(target==1){
break;
}
System.out.printf("%d:您想的数字是%d?\n",count++,target);
int res=in.nextInt();
if(res==0){
System.out.println("哈哈,我厉害吧!");
return;
}else if(res>0){
target^=1<<i;
}
}
System.out.println("那么,你想的数字一定是"+target);
}
}
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32