07. Equal Arrays
Дава ми 75/100! Ако някой може да помогне бих се радвал.
using System;
using System.Linq;
namespace _07._Equal_Arrays
{
internal class Program
{
static void Main(string[] args)
{
int[] arr1 = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
int firstArrNumber = 0;
int[] arr2 = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
int secondArrNumber = 0;
bool flag = true;
int sum = int.MinValue;
for (int i = 0; i < arr1.Length; i++)
{
firstArrNumber = arr1[i];
secondArrNumber = arr2[i];
if(firstArrNumber == secondArrNumber)
{
sum = firstArrNumber + secondArrNumber;
}
else
{
Console.WriteLine($"Arrays are not identical. Found difference at {i} index");
flag = false;
break;
}
}
if (flag == true)
{
Console.WriteLine("Arrays are identical. Sum: {0}", sum);
}
}
}
}