nikolayneykov

Untitled

Feb 24th, 2019
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.92 KB | None | 0 0
  1. using System;
  2. using System.Linq;
  3.  
  4. namespace _11ArrayManipulator
  5. {
  6.     class Program
  7.     {
  8.         static void Main(string[] args)
  9.         {
  10.             int[] arrayNumbers = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
  11.             string command = string.Empty;
  12.  
  13.             while ((command = Console.ReadLine()) != "end")
  14.             {
  15.                 string[] tokens = command.Split(' ');
  16.                 switch (command)
  17.                 {
  18.                     case "exchange":
  19.                         Exchange(arrayNumbers);
  20.                         break;
  21.                     case "max even":
  22.                         MaxEven();
  23.                         break;
  24.                     case "max odd":
  25.                         MaxOdd();
  26.                         break;
  27.                     case "min even":
  28.                         MinEven();
  29.                         break;
  30.                     case "min odd":
  31.                         MinOdd();
  32.                         break;
  33.                 }
  34.  
  35.                 if (command.StartsWith("first") && command.EndsWith("even")) // count чета в метода долу
  36.                 {
  37.                     FirstEven(int.Parse(tokens[1]));
  38.                 }
  39.                 else if (command.StartsWith("first") && command.EndsWith("odd")) // count чета в метода долу
  40.                 {
  41.                     FirstOdd(int.Parse(tokens[1]));
  42.                 }
  43.                 else if (command.StartsWith("last") && command.EndsWith("even")) // count чета в метода долу
  44.                 {
  45.                     LastEven(int.Parse(tokens[1]));
  46.                 }
  47.                 else if (command.StartsWith("last") && command.EndsWith("odd")) // count чета в метода долу
  48.                 {
  49.                     LastOdd(int.Parse(tokens[1]));
  50.                 }
  51.             }
  52.  
  53.         }
  54.  
  55.         private static void Exchange(int[] arrayNumbers)
  56.         {
  57.             int index = int.Parse(Console.ReadLine());
  58.             int[] splittedArray = null;
  59.             for (int i = 0; i < index; i++)
  60.             {
  61.                 arrayNumbers[i] = splittedArray[i];
  62.             }
  63.         }
  64.  
  65.         private static void MaxEven()
  66.         {
  67.             //throw new NotImplementedException();
  68.         }
  69.  
  70.         private static void MaxOdd()
  71.         {
  72.             //throw new NotImplementedException();
  73.         }
  74.  
  75.         private static void MinEven()
  76.         {
  77.             //throw new NotImplementedException();
  78.         }
  79.  
  80.         private static void MinOdd()
  81.         {
  82.             //throw new NotImplementedException();
  83.         }
  84.  
  85.         private static void FirstEven(int count)
  86.         {
  87.         }
  88.  
  89.         private static void FirstOdd(int count)
  90.         {
  91.  
  92.         }
  93.  
  94.         private static void LastEven(int count)
  95.         {
  96.  
  97.         }
  98.  
  99.         private static void LastOdd( int count)
  100.         {
  101.  
  102.         }
  103.     }
  104. }
Advertisement
Add Comment
Please, Sign In to add comment