for (int i=0;i<100;i++) { switch (i) { case 1 ... 10: NSLog(@"case 1 ... 10: = %d",i); break; case 11 ... 50: NSLog(@"case 11 ... 50: = %d",i); break; case 51 ... 100: NSLog(@"case 51 ... 100: = %d",i); break; } }
版权声明:本文为博主原创文章,未经博主允许不得转载。