2-2. Next is the time (15), and 2-2 is the time 15
Sometimes people use four digits to represent a time. For example, 1106 represents. Now, your program calculates the end time based on the start time and the elapsed time. Read two numbers. The first number represents the current time with four such digits, and the second number represents the number of minutes. The time after so many minutes is calculated, the result is also a four-digit number. When the hour is a single digit, there is no leading zero, that is, 05:30 represents 530. Note that the second digit indicates that the number of minutes may exceed 60 or a negative number.
Input Format:
The input is given two integers in a row, which are the start time indicated by four digits and the number of minutes of passage, separated by spaces. Note: In the start time, when the hour is a single digit, there is no leading zero, that is, 05:30 is expressed as 530. The number of minutes that have elapsed may exceed 60, or it may be a negative number.
Output Format:
Output four digits to indicate the end time. The question guarantee start time and end time are within the same day.
Input example:
1120 110
Output example:
1310
#import
#define msg (...) NSLog (__ VA_ARGS__)
#define mki (x) [NSNumber numberWithInt: x]
@interface Son: NSObject {
NSString * girl_friend_name;
}
// In the case of the default attribute is atomic, if the custom writer method must also customize the reader method,
// Or change the attribute to nonatomic mode.
@property (nonatomic) NSString * girl_friend_name;
-(void) think;
-(void) fall_in_love_with: (NSString *) girl_name;
@end
@implementation Son
@synthesize girl_friend_name;
-(void) fall_in_love_with: (NSString *) girl_name {
self.girl_friend_name = girl_name;
}
-(void) think {
msg (@ "My love girl is% @ ... Does baba know?", girl_friend_name);
}
+ (BOOL) automaticallyNotifiesObserversForKey: (NSString *) key {
if ([key isEqualToString: @ "girl_friend_name"])
return NO;
return YES;
}
-(void) setGirl_friend_name: (NSString *) name {
[self willChangeValueForKey: @ "girl_friend_name"];
// Let dad think that he is in love with female Xueba
girl_friend_name = @ "女 学 霸";
[self didChangeValueForKey: @ "girl_friend_name"];
// Restore it, BAD BOY ... :)
girl_friend_name = name;
}
@end
@interface Baba: NSObject {
Son * son;
}
@property Son * son;
@end
@implementation Baba
@synthesize son;
-(id) initWithSon: (Son *) son_v {
self = [super init];
if (self) {
son = son_v;
[son addObserver: self forKeyPath: @ "girl_friend_name" \
options: (NSKeyValueObservingOptionNew | \
NSKeyValueObservingOptionOld | NSKeyValueObservingOptionInitial) \
context: nil];
}
return self;
}
-(void) observeValueForKeyPath: (NSString *) key_path \
ofObject: (id) obj change: (NSDictionary *) change \
context: (void *) context {
NSString * old_name = [change objectForKey: NSKeyValueChangeOldKey];
NSString * new_name = [change objectForKey: NSKeyValueChangeNewKey];
if (! old_name) {
// NSKeyValueObservingOptionInitial option, the first hook will send a message
// In the future, a message will be sent for each change.
msg (@ "Yes, It's first time to induction son's girl_name !!!");
} else {
if ([new_name isEqualToString: @ "libinbin"]) {
[obj fall_in_love_with: @ "fanbinbin"];
}
msg (@ "My son's% @ change from% @ to% @ ... That's OK? :(", \
key_path, old_name, new_name);
}
}
-(void) dealloc {
[son removeObserver: self forKeyPath: @ "girl_friend_name"];
son = nil;
// [super dealloc];
}
@end
int main (int argc, char * argv [])
{
@autoreleasepool {
Son * son = [[Son alloc] init];
[son fall_in_love_with: @ "lili"];
[son think];
Baba * baba = [[Baba alloc] initWithSon: son];
[son fall_in_love_with: @ "mimi"];
[son think];
// My son originally liked libinbin, but ...
[son fall_in_love_with: @ "libinbin"];
// It was changed to fanbinbin by his dad with a special function!
[son think];
}
return 0;
}
What time is it?
The three o'clock P.M. of the 24-hour notation is of the 12-hour notation.
Who can tell me what happens when the stock market opens every day and then?
Am -- am is the auction time. am officially opened and closed at noon. AM to am is the trading time.