//
// main.m
// 06
//
// Created by Jo on 15/8/26.
// Copyright (c) 2015年 Jo. All rights reserved.
//
#import <Foundation/Foundation.h>
void day(int i,void (^myblock)()){
NSLog(@"第%d天:",i);
//NSLog(@" ");
NSLog(@"起床");
NSLog(@"刷牙");
NSLog(@"去车站");
NSLog(@"坐车");
//NSLog(@"%c",k);
myblock();
NSLog(@"去车站");
NSLog(@"坐车回家");
NSLog(@"吃饭");
NSLog(@"睡觉");
NSLog(@"------------");
}
int main(int argc, const char * argv[]) {
@autoreleasepool {
// insert code here...
//NSLog(@"Hello, World!");
//char k=0;
void (^myblock)();
for (int i=1; i<=5; i++) {
switch (i) {
case 1:
//k='a';
myblock=^{NSLog(@"(了解项目)");};
break;
case 2:
//k='b';
myblock=^{NSLog(@"(分析项目)");};
break;
case 3:
//k='c';
myblock=^{NSLog(@"(写代码)");};
break;
case 4:
//k='d';
myblock=^{NSLog(@"(写调试代码)");};
break;
case 5:
//k='e';
myblock=^{NSLog(@"(离职)");};
break;
}
day(i,myblock);
}
}
return 0;
}
|
|