1 - A 2 - B ….. 26 - Z 27 - AA 52 - AZ 53 - BA 54 - BB …. 702 - ZZ … 8888888888-ABTCNCWV 输入左边数字就输出右边对应字母; */ NSMutableArray *arr = [[NSMutableArray alloc] init]; while(n){ int mod = n % 26; if(mod == 0){ mod=26; n--; }; [arr insertObject:[NSString stringWithFormat:@"%c",'A'-1+mod] atIndex:0]; n = n / 26; } NSLog(@"%@",[arr componentsJoinedByString:@""]); |
|