15 lines
412 B
Objective-C
15 lines
412 B
Objective-C
#import <Foundation/Foundation.h>
|
|
#include <stdio.h>
|
|
#include <assert.h>
|
|
int remaining(int total, int done) { return done >= total ? 0 : total - done; }
|
|
int main(void) {
|
|
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
|
assert(remaining(4,1)==3);
|
|
assert(remaining(4,4)==0);
|
|
assert(remaining(4,5)==0);
|
|
assert(remaining(0,0)==0);
|
|
puts("Passed");
|
|
[pool drain];
|
|
return 0;
|
|
}
|