#import <Foundation/Foundation.h>
@interface chengFaBiao : NSObject
-(void)jiuJiuBiao;
@end
@implementation chengFaBiao
-(void)jiuJiuBiao{
NSString *str[10];
str[0]=@"";
for (int i=1; i<10; i++) {
for (int j=1; j<i+1; j++) {
str=[[NSString alloc] initWithString:[NSString stringWithFormat:@"%d*%d=%2d %@",j,i,i*j,str[i-1]]];
}
NSLog(@"%@",str);
}
NSLog(@"paoqilaile");
}
@end
int main(int argc, const char * argv[]) {
@autoreleasepool {
chengFaBiao *jiu=[chengFaBiao new];
[jiu jiuJiuBiao];
}
return 0;
} |