题解 | #小乐乐查找数字#
小乐乐查找数字
https://www.nowcoder.com/practice/4c49a3a1559141f7a080a48c98cca4cb
#include <stdio.h> #define N 110 int a[N]; int cnt[N] = {0}; int main() { int n; scanf("%d", &n); for (int i = 0; i < n; i ++ ) { scanf("%d", &a[i]); cnt[a[i]] ++ ; } int x; scanf("%d", &x); printf("%d", cnt[x]); return 0; }