[ACM ] 10815
( *[1m *[m 為色碼,可以按 Ctrl+V 預覽會顯示的顏色 )
( 未必需要依照此格式,文章條理清楚即可 )
題號:10815 http://0rz.tw/uypJA
遇到的問題:
不知為何一直Wrong answer = ="
有問題的code: (請善用置底文的標色功能)
#include<iostream>
#include<string>
#include<map>
#include<cctype>
using namespace std;
int main()
{
string x;
string::iterator str;
map<string,int> word;
map<string,int>::iterator p;
while(cin>>x,!cin.eof())
{
for(str=x.begin();str!=x.end();)
{
if(!isalpha(*str))
str=x.erase(str);
else
{
*str=tolower(*str);
++str;
}
}
word[x];
}
for(p=word.begin();p!=word.end();++p)
cout<<p->first<<endl;
}
補充說明:
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.112.241.200
※ 編輯: flash5408 來自: 140.112.241.200 (03/01 00:06)
推
03/01 00:52, , 1F
03/01 00:52, 1F
→
03/01 00:53, , 2F
03/01 00:53, 2F
→
03/01 00:54, , 3F
03/01 00:54, 3F
→
03/01 00:58, , 4F
03/01 00:58, 4F
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章