Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Problem8_SumArray
- {
- class Program
- {
- static void Main(string[] args)
- {
- var arr1 = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
- var arr2 = Console.ReadLine().Split(' ').Select(int.Parse).ToArray(); ;
- var n = Math.Max(arr1.Length, arr2.Length);
- var sumArr = new int[n];
- for (int i = 0; i < n; i++)
- sumArr[i] =
- arr1[i % arr1.Length] +
- arr2[i % arr2.Length];
- Console.WriteLine(string.Join(" ", sumArr));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement