main.m//job 1////Created by syrcfwzx on 16/1/9.//Copyright (c) 2016 SYRCFWZX. All rights reserved.//#import <Foundation/Foundation.h> #define NSLOG (FORMAT, ...) printf ("%s\n", [[NSString Stringwithformat:format, # #__VA_ARGS__] utf8string]) int main (int argc, const char * argv[]) {@autoreleasepool { nsnumber* num = [NSNumber numberwithint:123456789]; nsstring* str = [NSString stringwithformat:@ "%@", Num]; nsmutablestring* reverse = [nsmutablestring string]; nsmutablearray* array = [Nsmutablearray array]; Nsinteger len = [str length]; for (Nsinteger i=len-1;i>=0;i--) {Unichar c = [str characteratindex:i]; nsstring* temp = [NSString stringwithcharacters:&c length:1]; [Array addobject:temp]; } for (the ID obj in array) {NSLog (@ "%@", obj); } NSLog (@ "??????????????????????????????????????"); nsmutablearray* arr = [Nsmutablearray aRray]; For (Nsinteger i =str.length-1;i>=0;i--) {nsstring* STR4 = [Str Substringwithrange:nsmakerange (I, 1)] ; [Arr ADDOBJECT:STR4]; } for (id obj in arr) {NSLog (@ "%@", obj); }} return 0;}
1-9 Job 1