Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

为啥我的vc6用map时总是报错,但是在评测系统中能ac?(附代码,请大牛指点!)

Posted by 1805180411 at 2012-08-14 14:26:43 on Problem 2418
#include<iostream>
#include<string>
#include<map>
using namespace std;

int main()
{
	string str;
	int sum = 0;
	map<string,int> mp;
	map<string,int>::iterator iter;
	while(getline(cin,str))
	{
		mp[str]++;
		sum++;
	}
	for(iter = mp.begin();iter != mp.end();iter++)
	{
		cout<<iter->first;
		printf(" %.4f\n",(iter->second)*100.0/sum);
	}
	return 0;
}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator