#include<iostream>
#include <string>
using namespace std;
int main()
{
	string First, Middle, Last;
    	char ch;
	int n;
	cout << "Enter the first name: ";
	cin >> First;
	cout << "Enter the middle name: ";
	cin >> Middle;
	cout << "Enter the last name: ";
	cin >> Last;
	if (First[0] >= 'a' && First[0] <= 'z')
	{
		n = int(First[0]);
		n = n - 32;
		First[0] = char(n);
	}
	if (Middle[0] >= 'a' && Middle[0] <= 'z')
	{
		n = int(Middle[0]);
		n = n - 32;
		Middle[0] = char(n);
	}
	if (Last[0] >= 'a' && Last[0] <= 'z')
	{
		n = int(Last[0]);
		n = n - 32;
		Last[0] = char(n);
	}
	cout << endl;
	cout << "Press 1 to display the name "
		<< "(in the format Last, First Middle)." 
		<< endl;
	cout << "Press 2 to display the initials "
		<< "(in the format F.M.L.)." 
		<< endl;
	cout << endl;
	cin >> ch;
	cout << endl;
	if (ch == '1')
	{
		cout << Last << ", " << First << " " 
			<< Middle << "." << endl << endl;
	}
	else if (ch == '2')
	{
		cout << First[0] << "." << Middle[0] << "." 
			<< Last[0] << "." << endl << endl;
	}
	else
		cout << "Invalid Input" << endl << endl;
	system("pause");

        return 0;
}    
