Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- using System.Collections.Generic;
- namespace matrixretakeexamadvanced
- {
- class Program
- {
- static void Main(string[] args)
- {
- int n = int.Parse(Console.ReadLine());
- Queue<int> dataToRotate = new Queue<int>(Console.ReadLine().Split(" ", StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray());
- int realRotate = n % dataToRotate.Count;
- for (int i = 0; i < realRotate; i++)
- {
- int diff = dataToRotate.Dequeue();
- dataToRotate.Enqueue(diff);
- }
- Console.WriteLine(string.Join(" ", dataToRotate));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment