Advertisement
Guest User

Untitled

a guest
Apr 2nd, 2020
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.14 KB | None | 0 0
  1. using System;
  2. using System.Collections.Concurrent;
  3. using System.ComponentModel.DataAnnotations;
  4. using System.Diagnostics.CodeAnalysis;
  5. using System.Linq;
  6. using System.Linq.Expressions;
  7. using System.Runtime.InteropServices.ComTypes;
  8. using System.Text;
  9. using System.Threading;
  10.  
  11. namespace HelloWorld
  12. {
  13.     class Program
  14.     {
  15.         static void Main(string[] args)
  16.         {
  17.             int[] arr1 = Console
  18.             .ReadLine()
  19.             .Split()
  20.             .Select(int.Parse)
  21.             .ToArray();
  22.  
  23.             int[] arr2 = Console
  24.             .ReadLine()
  25.             .Split()
  26.             .Select(int.Parse)
  27.             .ToArray();
  28.  
  29.             bool isSame = false;
  30.             for (int i = 0; i < arr1.Length; i++)
  31.             {
  32.                 if (arr1[i] == arr2[i])
  33.                 {
  34.                    isSame = true;
  35.                 }
  36.             }
  37.             if (isSame)
  38.             {
  39.                 Console.WriteLine($"Yes, they are the same: {string.Join(" ", arr1)}");
  40.             }
  41.             else
  42.             {
  43.                 Console.WriteLine("No, they are not.");
  44.             }
  45.         }
  46.     }
  47.  
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement