Guest User

Untitled

a guest
Sep 9th, 2016
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. class Program
  8. {
  9. static void Main(string[] args)
  10. {
  11. var arr1 = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
  12. var arr2 = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
  13. var n = Math.Max(arr1.Length, arr2.Length);
  14. var sumArr = new int[n];
  15. for (int i = 0; i < n; i++)
  16. {
  17. sumArr[i] = arr1[i % arr1.Length] + arr2[i % arr2.Length];
  18. }
  19. Console.WriteLine(string.Join(" ", sumArr));
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment