Class Program {
static void Main(string[] args)
{
Console.ForegroundColor = ConsoleColor.Green;
Queue queueDigits = new Queue ();
string input = "";
string[] cuted;
Console.ForegroundColor = ConsoleColor.Red;
Console.Write("Input:");
Console.ForegroundColor = ConsoleColor.Green;
input = Console.ReadLine();
cuted = input.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
for (int i = cuted.Length - 1; i >= 0; i--)
{
queueDigits.Enqueue(cuted[i]);
}
while(queueDigits.Count>0)
{
Console.Write(queueDigits.Peek().ToString() + " ");
queueDigits.Dequeue();
}
Console.ReadKey();
}
}
}
Поясніть код будь ласка