Advertisement
Guest User

Outside the bounds of the array

a guest
Oct 8th, 2017
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. using System;
  2. using System.Linq;
  3.  
  4. class LargestCommonEnd
  5. {
  6. static void Main(string[] args)
  7. {
  8. string[] arr = Console.ReadLine().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
  9. string[] arr2 = Console.ReadLine().Split(new char[] {' '}, StringSplitOptions.RemoveEmptyEntries);
  10. int Similar = Math.Min(arr.Length, arr2.Length);
  11. for (int i = 0; i <= Similar; i++)
  12. {
  13. if (arr[i]==arr2[i])
  14. {
  15. Console.WriteLine(arr.Length);
  16. }
  17. }
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement