#import <Foundation/Foundation.h>
int main(int argc, const char * argv[]) {
@autoreleasepool {
int input;
int index;
NSLog(@"输入数字>>>");
scanf("%d",&input);
NSMutableString *str = [NSMutableString stringWithFormat:@"%d",input];
NSArray *eng = @[@"Zero",@"One",@"Two",@"Three",@"Four",@"Five",@"Six",@"Seven",@"Eight",@"Nine"];
NSMutableString *engout = [NSMutableString string];
for (int i = 0; i < str.length; i++) {
index = [str characterAtIndex:i] - 48;
[engout appendString:eng[index]];
[engout appendString:@" "];
}
NSLog(@"%@",engout);
}
return 0;
}
|
|