Advertisement
peshopbs2

Untitled

Jan 20th, 2020
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace CommandProcess
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. string command = Console.ReadLine();
  14.  
  15. while(command!="End")
  16. {
  17. ProcessCommand(command);
  18. command = Console.ReadLine();
  19. }
  20. }
  21.  
  22. private static void ProcessCommand(string command)
  23. {
  24. string[] commandData = command.Split(' ').ToArray();
  25.  
  26. switch(commandData[0])
  27. {
  28. case "Print":
  29. Console.WriteLine("The command is print");
  30. break;
  31. case "Add":
  32. Console.WriteLine("The command is add");
  33. break;
  34. default:
  35. Console.WriteLine("The command {0} is not supported",
  36. commandData[0]);
  37. break;
  38. }
  39. }
  40. }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement