switchはテクニックを使う
398 ワード
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;
}
}