Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- namespace SumEvenNumbers
- {
- class Program
- {
- static void Main(string[] args)
- {
- int[] arrOne = Console.ReadLine()
- .Split()
- .Select(int.Parse)
- .ToArray();
- int[] arrTwo = Console.ReadLine()
- .Split()
- .Select(int.Parse)
- .ToArray();
- if (arrOne.SequenceEqual(arrTwo))
- {
- Console.WriteLine($"Arrays are identical. Sum: {arrOne.Sum()}");
- }
- else
- {
- for (int i = 0; i < arrOne.Length; i++)
- {
- if (arrOne[i] != arrTwo[i])
- {
- Console.WriteLine($"Arrays are not identical. Found difference at {i} index");
- break;
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement