Expand|Select|Wrap|Line Numbers
- int EXIT=1;
- int main()
- {
- System system = {{getline}, {println}};
- while (EXIT)
- {
- printf("# ");
- char exit[] = "exit";
- char help[] = "help";
- char dataInput[80];
- int choice;
- gets(dataInput);
- if(strcmp (dataInput, exit ) == 0)
- {
- choice = 1;
- }
- else if(strcmp (dataInput, help ) == 0)
- {
- choice=2;
- }
- else
- {
- choice=0;
- }
- switch (choice)
- {
- case 1: system.out.println("System Shutdown...");
- EXIT=0;
- break;
- case 2: system.out.println("No Help for NOOBS!");
- break;
- default: printf("Command not recognized!\n");
- break;
- }
- }
- return 0;
- }