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