01: The number of the specified number of the same number

01: The number of the specified number of the same number

#include <stdio.h>
#define MAXN 10000+7
int a[MAXN];
int main()
{
	int i,n,num,count=0;
	scanf("%d",&n);		
	for(i=0;i<n;i++)scanf("%d",&a[i]);
	scanf("%d",&num);
	for(i=0;i<n;i++)if(a[i]==num)count++;
	printf("%d\n",count);
        return 0;
}

 

Guess you like

Origin blog.csdn.net/qq_42861250/article/details/90733114