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