poj1002

#include 
#include 
#include 
#include 
#include 
using namespace std;
int main()
{
	freopen("in.txt","r",stdin);
	int N;
	cin >> N;
	vector vNumCode;
	
	for (int i=0; i> strInput;
		vNumCode.push_back(strInput);
	}
	for(int k=0; k mapRes;
	for (vector::iterator ite = vNumCode.begin(); ite != vNumCode.end(); ite++)
	{
		++mapRes[*ite];
	}
	

	bool cout_flag(false);    
	for (map::iterator iter = mapRes.begin();iter != mapRes.end();iter++)  
	{  
		if ( (iter->second) > 1)  
		{  
			cout << iter->first << " " << iter->second << endl;  
			cout_flag = true;  
		}  
	}  

	if ( !cout_flag )  
	{  
		cout << "No duplicates.";  
	}  
	return 0;
}

你可能感兴趣的:(c++学习,算法,iterator,string,include,c)