| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
10002在VS2008上面测试一点问题都没有 结果CE了!代码:c++
#include "iostream"
#include<cmath>
#include<string>
#include<vector>
#include<algorithm>
#include<cstdlib>
using namespace std;
string replacestring1(string s){
while(s.find('-',0)!=-1){
int findposition=s.find('-',0);
s=s.erase(findposition,1);
}
replace(s.begin(),s.end(),'A','2');
replace(s.begin(),s.end(),'B','2');
replace(s.begin(),s.end(),'C','2');
replace(s.begin(),s.end(),'D','3');
replace(s.begin(),s.end(),'E','3');
replace(s.begin(),s.end(),'F','3');
replace(s.begin(),s.end(),'G','4');
replace(s.begin(),s.end(),'H','4');
replace(s.begin(),s.end(),'I','4');
replace(s.begin(),s.end(),'J','5');
replace(s.begin(),s.end(),'K','5');
replace(s.begin(),s.end(),'L','5');
replace(s.begin(),s.end(),'M','6');
replace(s.begin(),s.end(),'N','6');
replace(s.begin(),s.end(),'O','6');
replace(s.begin(),s.end(),'P','7');
replace(s.begin(),s.end(),'R','7');
replace(s.begin(),s.end(),'S','7');
replace(s.begin(),s.end(),'T','8');
replace(s.begin(),s.end(),'U','8');
replace(s.begin(),s.end(),'V','8');
replace(s.begin(),s.end(),'W','9');
replace(s.begin(),s.end(),'X','9');
replace(s.begin(),s.end(),'Y','9');
return s;
}
int main(){
int n;
cin>>n;
string inputstring;
vector<string> sz;
for(int i=0;i<n;i++){
cin>>inputstring;
sz.push_back(inputstring);
}
for(int i=0;i<n;i++){
string s=sz[i];
sz[i]=replacestring1(s);
}
vector<int> resultcf(n);
string sumstring;
for(int i=0;i<n;i++)
{
sumstring.append(sz[i]);
}
for(int i=0;i<n;i++)
{
for(int j=0;j<n;j++)
{
if(i==j){
continue;
}
else
{
if(sz[j]==sz[i])
{
resultcf[i]+=1;
}
}
}
}
vector<string> finallyresult;
for(int i=0;i<n;i++)
{
int x=0;
if(i>=1)
{
for(int j=0;j<=i-1;j++)
{
if(sz[i]==sz[j])
{
x+=1;
}
}
}
if(x==0&&resultcf[i]>0)
{
char tem[200];
itoa((resultcf[i]+1),tem,10);
finallyresult.push_back(sz[i] + " " + tem);
}
}
if(finallyresult.size()==0)
{
cout << "No duplicates." <<endl;
}
else
{
for(int i=0; i<int(finallyresult.size());i++)
{
cout<<finallyresult[i].insert(3,"-")<<endl;
}
}
system("pause");
return 0;
}
很不解啊!...
错误消息是
Compile Error
Main.cpp
Main.obj : error LNK2019: unresolved external symbol _itoa referenced in function _main
Main.exe : fatal error LNK1120: 1 unresolved externals
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator