题解 | #小乐乐查找数字#
小乐乐查找数字
https://www.nowcoder.com/practice/4c49a3a1559141f7a080a48c98cca4cb
#include <stdio.h> int main() { int num = 0;; while (scanf("%d", &num) != EOF) { int arr[100] = {0}; int target = 0; for (int i = 0; i < num; i++) { scanf("%d", arr+i); } scanf("%d",&target); int sum = 0; for (int i = 0; i <num; i++) { if (arr[i] == target) { sum++; } } printf("%d",sum); } return 0; }