Created
July 3, 2012 10:04
-
-
Save pita5/3038870 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int stack_machine_emulator (NSString *S) | |
{ | |
NSScanner* scanner = [NSScanner scannerWithString:S]; | |
[scanner setCharactersToBeSkipped:[NSCharacterSet characterSetWithCharactersInString:@"*+"]]; | |
NSInteger nextInt; | |
while ([scanner scanInteger:&nextInt]) | |
{ | |
NSLog(@"%d", nextInt); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment