Advertisement
Nehorowo

structadd

Dec 16th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.74 KB | None | 0 0
  1.                 if (command.StartsWith("add"))
  2.                 {
  3.                     var commandParts = command.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
  4.                     if (commandParts.Length < 3)
  5.                         Console.WriteLine($"Wrong arguments count.");
  6.                     else
  7.                     {
  8.                         if (Complex.TryParse(commandParts[1], out Complex c1) &&
  9.                             Complex.TryParse(commandParts[2], out Complex c2))
  10.                         {
  11.                             var result = c1.Add(c2);
  12.                             Console.WriteLine(result.ToString());
  13.                         }
  14.                     }
  15.                 }
  16.                 else if
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement