Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- namespace wew
- {
- class MainClass
- {
- public static void Main(string[] args)
- {
- var nums = Console.ReadLine()
- .Split()
- .Select(int.Parse)
- .ToArray();
- var numInterations = int.Parse(Console.ReadLine());
- int[] sum = new int[nums.Length];
- for (int i = 0; i < numInterations; i++)
- {
- var last = nums[nums.Length - 1];
- for (int j = nums.Length -1 ; j > 0; j--)
- {
- nums[j] = nums[j - 1];
- }
- nums[0] = last;
- for (int k = 0; k < nums.Length; k++)
- {
- sum[k] += nums[k];
- }
- }
- Console.WriteLine(string.Join(" ",sum));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement