04. Array Rotation , Exercise: Arrays - C# Fundamentals
Здравейте , реших задачата по един начин , сега направих по съкратен вариант , но Judg -а ми дава половината тестове верни, половината грешни . Това е повтарящ се код и как може завъртян 2 пъти да е правилен, а завъртян 5 пъти да е грешен .Помогнете ако може с какво греша
Write a program that receives an array and number of rotations you have to perform (first element goes at the end) Print the resulting array.
Examples
| Input | Output | 
| 51 47 32 61 21 2 | 32 61 21 51 47 | 
| 32 21 61 1 4 | 32 21 61 1 | 
| 2 4 15 31 5 | 4 15 31 2 
 | 
Write a program that receives an array and number of rotations you have to perform (first element goes at the end) Print the resulting array.
Examples
| Input | Output | 
| 51 47 32 61 21 2 | 32 61 21 51 47 | 
| 32 21 61 1 4 | 32 21 61 1 | 
| 2 4 15 31 5 | 4 15 31 2 
 | 
using System;
using System.Linq;
namespace ConsoleApp2
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] arrayInput = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int rounds = int.Parse(Console.ReadLine());
            int temporary = 0;
            for (int k = 0; k < rounds; k++)
            {
                temporary = arrayInput[0];
                arrayInput[0] = arrayInput[arrayInput.Length - 1];
                for (int i = arrayInput.Length - 1; i > 1; i--)
                {                    
                    arrayInput[i] = arrayInput[i - 1];
                }
                arrayInput[1] = temporary;
            }
                
            foreach (var item in arrayInput)
            {
                Console.Write(item.ToString() + " ");
            }
        }
    }
}
 
Благодаря за отговора , ще поправя грешката
Поздрави