#include <stdio.h>//遍历数组,记录x的出现次数 #include <stdlib.h> int main() { int n,x; int count = 0; //记录x的出现次数 scanf("%d", &n); int* a = (int*)malloc(sizeof(int)*n); for(int i = 0; i < n; i++) { scanf("%d", &a[i]); } scanf("%d", &x); for(int i = 0; i < n; i++) { if(x == a[i]) count++; } printf("%d", count); return 0; }