#import <Foundation/Foundation.h>
int main (int argc, const char * argv[])
{
@autoreleasepool {
// insert code here...
NSLog(@"Hello, World!");
NSString *nameString = [NSString stringWithContentsOfFile:@"/usr/share/dict/propernames" encoding:NSUTF8StringEncoding error:NULL];
NSArray *names = [nameString componentsSeparatedByString:@"\n"];
NSString *wordString = [NSString stringWithContentsOfFile:@"/usr/share/dict/words" encoding:NSUTF8StringEncoding error:NULL];
NSArray *words = [wordString componentsSeparatedByString:@"\n"];
for (NSString *n in names)
{
for (NSString *w in words)
{
if ([n caseInsensitiveCompare: w] == NSOrderedSame)
{
if ([n compare: w] == NSOrderedAscending)
{
NSLog(@"%@ and %@ match", n, w);
}
}
}
}
}
return 0;
}