int main(int argc, const char * argv[]) {
@autoreleasepool {
// NSMutableString *str = @[@123, @"abv"];
// NSLog(@"%@",str);
int i = arc4random()%100;
int j=-1;
int count=0;
while (i!=j&&count<=10) {
scanf("%d",&j);
if (j<i) {
NSLog(@"<");
}else if(j>i){
NSLog(@">");
}else NSLog(@"==");
count++;
if(count>10){
NSLog(@"out");
return 0;
}
}
NSLog(@"初始化得数为: %d 惨重的数字为: %d",i,j);
}
return 0;
}
我是这么写的,lz可以看看 |