帮看看这段C++程序!怎么会有100个Warning的啊!!没有Error!运行也行的!
/* Read a sequence of possibly whitespace-separated (name, value) pairs, where the name is a single whitespace-separated
word and the value is a floating-point value. Compute and print the sum for each name.
*/
#include<iostream>
#include<map>
#include<string>
using namespace std;
map<string,int>phone_book;
void main()
{
string str1;
int num;
cin>>str1;
cin>>num;
while(str1!="#")
{
phone_book[str1]+=num;
cin>>str1;
cin>>num;
}
for(map<string,int>::const_iterator p=phone_book.begin();p!=phone_book.end();++p)
{
cout<<p->first<<" "<<p->second<<endl;
}
}