I have a little trouble with this part of my programming and i hope someone out there can help me. All the numbers needs to be as they are (0 can't be deleted)
Code:
#import <Foundation/Foundation.h>
int main (int argc, const char * argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
int userNUM;
NSLog(@"Write number here");
scanf("%i", &userNUM);
switch (userNUM) {
case 0015 :
NSLog(@"547048");
break;
case 0172 :
NSLog(@"853846");
break;
case 0245 :
NSLog(@"055201");
break;
case 0360 :
NSLog(@"424839");
break;
case 0372 :
NSLog(@"401574");
break;
case 0427 :
NSLog(@"054376");
break;
case 0433 :
NSLog(@"280993");
break;
case 0485 : invalid digit "8" in octal constant
NSLog(@"856448");
break;
case 0554 :
NSLog(@"523721");
break;
case 0654 :
NSLog(@"298401");
break;
case 0673 :
NSLog(@"913189");
break;
case 0678 : invalid digit "8" in octal constant
NSLog(@"005165");
break;
case 0742 :
NSLog(@"845915");
break;
case 0828 : invalid digit "8" in octal constant
NSLog(@"785730");
break;
case 0950 : invalid digit "9" in octal constant
NSLog(@"227521");
break;
default:
break;
}
[pool drain];
return 0;
Code:
#import <Foundation/Foundation.h>
int main (int argc, const char * argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
int userNUM;
NSLog(@"Write number here");
scanf("%i", &userNUM);
switch (userNUM) {
case 0015 :
NSLog(@"547048");
break;
case 0172 :
NSLog(@"853846");
break;
case 0245 :
NSLog(@"055201");
break;
case 0360 :
NSLog(@"424839");
break;
case 0372 :
NSLog(@"401574");
break;
case 0427 :
NSLog(@"054376");
break;
case 0433 :
NSLog(@"280993");
break;
case 0485 : invalid digit "8" in octal constant
NSLog(@"856448");
break;
case 0554 :
NSLog(@"523721");
break;
case 0654 :
NSLog(@"298401");
break;
case 0673 :
NSLog(@"913189");
break;
case 0678 : invalid digit "8" in octal constant
NSLog(@"005165");
break;
case 0742 :
NSLog(@"845915");
break;
case 0828 : invalid digit "8" in octal constant
NSLog(@"785730");
break;
case 0950 : invalid digit "9" in octal constant
NSLog(@"227521");
break;
default:
break;
}
[pool drain];
return 0;