#include <iostream>
#include <string>
using namespace std;
string move1(string s);
void move2(string s, string& t);

int main()
{
	string s, t;
	cout<<"Enter a string: "<<endl;
	getline(cin, s);
	cout << "The string you entered is: \n";
	cout << s << endl;
	cout << "The string returned by the first function is:\n";
	cout << move1(s) << endl;
	move2(s,t);
	cout << "The string returned by the second function is:\n";
	cout << t << endl;
	system("pause");
	return 0;
}

string move1(string s)
{
	string a="", b="", c = "", t;
	int i, n = s.size();
	for (i = 0; i < n; i++)
		if (s[i] >= 'A' && s[i] <= 'Z')
			a = a + s[i];
		else if (s[i] >= 'a' && s[i] <= 'z')
			b = b + s[i];
		else
			c = c + s[i];
	t = a + b + c;
	return t;
}

void move2(string s, string& t)
{
	string a="", b="", c = "";
	int i, n = s.size();
	for (i = 0; i < n; i++)
		if (s[i] >= 'A' && s[i] <= 'Z')
			a = a + s[i];
		else if (s[i] >= 'a' && s[i] <= 'z')
			b = b + s[i];
		else
			c = c + s[i];
	t = a + b + c;
}