题解 | #小乐乐查找数字#
小乐乐查找数字
http://www.nowcoder.com/practice/4c49a3a1559141f7a080a48c98cca4cb
int main() {
int n, count = 0;
scanf("%d", &n);
int m[n + 1];
for (int i = 0; i < n + 1; i++) {
scanf("%d ", &m[i]);
}
for (int j = 0; j < n; j++) {
if (m[j] == m[n]) //判断当前数是否与查找数相等
count++;
}
printf("%d", count);
return 0;
}