文章

60

粉丝

361

获赞

41

访问

498.7k

头像
签到题
P1329 浙江大学机试题
发布于2021年1月20日 11:20
阅读数 8.8k

#include <iostream>
#include <string>
#include <string.h>
#include <map>
using namespace std;

int main()
{
	int n;
	while(cin>>n)
	{
		map<int,int>m;
		int temp;
		if(n==0)
			break;
		for(int i=0;i<n;i++)
		{
			cin>>temp;
			m[temp]++;
		}
		int gore;
		cin>>gore;
		if(m.find(gore)!=m.end())
			cout<<m[gore]<<endl;
		else
			cout<<0<<endl;
	}
	return 0;
}

 

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发