ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1196. History Exam

wa2
Posted by SamGTU7_Kareva Nadezhda Vladimirovna 26 May 2013 21:50
Help me find a mistake

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace курсач_1196
{
    class Program
    {
        static void Main(string[] args)
        {
            int n1 = int.Parse(Console.ReadLine());
            int[] a = new int[n1];
            for (int i = 0; i < n1; i++)
                a[i] = int.Parse(Console.ReadLine());
            int n2 = int.Parse(Console.ReadLine());
            int[] b = new int[n2];
            for (int j = 0; j < n2; j++)
                b[j] = int.Parse(Console.ReadLine());
            Array.Sort(a);
            int[] ab = a.Intersect(b).ToArray();
            Console.WriteLine(ab.Length);

        }
    }
}