using namespace std;
bool LinearSearch(int A[], int n, int key) {
A[n] = key;
int i = 0;
while (A[i] != key)
i++;
return i != n;
}
int main() {
int n, q, key;
int sum = 0;
int A[10000 + 10];
scanf("%d", &n);
for (int i = 0; i < n; i++)
scanf("%d", &A[i]);
scanf("%d", &q);
for (int i = 0; i < q; i++) {
scanf("%d", &key);
if (LinearSearch(A, n, key))
sum++;
}
printf("%d\n", sum);
}
alds1_4_a 2018-2-11
最新推荐文章于 2020-04-16 10:29:35 发布