Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Diagnostics.CodeAnalysis;
- using System.Linq;
- using System.Numerics;
- namespace SoftuniExercisesWithVariables
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.WriteLine("Enter your array here: ");
- int[] array = Console.ReadLine().Split(" ").Select(int.Parse).ToArray();
- Console.WriteLine("Enter number of changes you want: ");
- int changes = int.Parse(Console.ReadLine());
- while(changes>0)
- {
- int temp = array[0];
- for (int i = 0; i < array.Length-1; i++)
- {
- array[i] = array[i + 1];
- }
- array[array.Length - 1] = temp;
- changes--;
- }
- foreach(int i in array)
- {
- Console.Write(i + " ");
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment