Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Disclaimer: The creator of 'C# Shell (C# Offline Compiler)' is in no way responsible for the code posted by any user.
- using System;
- using System.IO;
- using System.Linq;
- using System.Collections.Generic;
- namespace CSharp_Shell
- {
- public static class Program
- {
- public static void Main()
- {
- int[] arr = Console.ReadLine()
- .Split()
- .Select(int.Parse)
- .ToArray();
- int n = int.Parse(Console.ReadLine());
- for (int i=0; i<n; i++)
- {
- int[] rotated = new int[arr.Length];
- for(int j=0; j< arr.Length-1;j++)
- {
- int a = arr[0];
- rotated[j] = arr[j+1];
- rotated[arr.Length-1] = a;
- }
- arr = rotated;
- }
- Console.WriteLine(string.Join(" ", arr));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement