hdu 杭电 1106老是WA,不知道哪儿错了。求高手指教~~谢了~~

2024-12-19 16:00:13
推荐回答(1个)
回答1:

#include
using namespace std;
#include
#include
#include
#include
int main()
{
map m;
int i;
for (i = 0;i < 10; i++)
{
m['0' + i] = i;
}
string ss;
vector vv;
int sum;
while (cin>>ss)
{
vv.clear();
sum = 0;
for (i = 0;i <= ss.length();i++)
{
if (i==ss.length()||m[ss[i]] == 5)
{
if (i != 0&&m[ss[i -1]] != 5||i==ss.length()&&m[ss[i - 1]] != 5)
vv.push_back(sum);
sum = 0;
}
else
{
sum = sum * 10 + m[ss[i]];
}
}
sort(vv.begin(),vv.end());
cout< for(i = 1;i < vv.size(); i++)
{
cout<<" "< }
cout< }
//system ("pause");
return 0;
}