int a=5; int b=4; //输出前面补0,不管你输入的数据前面有没有0 sp;NSLog(@"====>%@",[NSString stringWithFormat:@"%02d:%02d",a,b]);