学校说要把我们包装成有一两年工作经验的....但我这样的从小小抄都没打过,未免有些心虚.还想请教下前辈们就业时候要有一种什么样的心态.我觉得经过这四个月的学习,我是很喜欢这一行,毕竟能学的进去,比在学校混时间充实多了.
另外看到知乎,有一家公司说他们面试的上机题是写个方法将字符串反转,如-123456变为-654321,决定测试下自己的实力,写了这样一个方法,希望前辈们指点一下.(第一次发帖子里面含代码的,不知道发的对不对)
- - (NSString *)flipString:(NSString *)aString
- {
- NSMutableString *str = [NSMutableString string];
- NSMutableString *flip = [NSMutableString string];
- for (int i = aString.length-1; i >= 1; i--)
- {
- unichar s = [aString characterAtIndex:i];
- [str appendString:[NSString stringWithCharacters:&s length:1]];
- }
- unichar f = [aString characterAtIndex:0];
- NSString *fli = [NSString stringWithCharacters:&f length:1];
- if ([fli isEqualToString:@"-"])
- {
- flip = [NSMutableString stringWithFormat:@"%@%@",fli,str];
- }
- else
- {
- flip = [NSMutableString stringWithFormat:@"%@%@",str,fli];
- }
- return flip;
- }
复制代码
|
|