Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int[] array = Console.ReadLine()
- .Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries)
- .Select(int.Parse)
- .ToArray();
- int numOfRotations = int.Parse(Console.ReadLine());
- for (int rotation = 1; rotation <= numOfRotations; rotation++)
- {
- int first = array[0];
- for (int i = 0; i < array.Length - 1; i++)
- {
- array[i] = array[i + 1];
- }
- array[array.Length - 1] = first;
- }
- Console.Write(string.Join(" ", array));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement