文章
49
粉丝
90
获赞
9
访问
26.7k
#include <iostream>
#include <vector>
using namespace std;
void print(vector<char>v)
{
vector<char>::iterator it;
for (it = v.begin(); it < v.end(); it++)
{
cout << *it;
}
cout << endl;
}
int main()
{
vector<char>c;
vector<char>i;
vector<char>other;
string s;
while (cin >> s)
{
string::iterator it;
for (it = s.begin(); it < s.end(); it++)
{
if (*it >= 'a' && *it <= 'z' || *it >= 'A' && *it <= 'Z')
{
c.push_back(*it);
}
else if (*it >= '0' && *it <= '9')
{
i.push_back(*it);
}
else
{
other.push_back(*it);
}
}
print(c);
print(i);
print(other);
}
return 0;
}
登录后发布评论
暂无评论,来抢沙发