/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
public static void main (String[] args) throws java.lang.Exception
{
#include <iostream> // Chapter 1 - includes cout, cin, endl, and other basic functions
#include <cmath> // Chapter 2 - includes advanced math functions (exponential, trig, etc)
#include <cstdlib> // Contains functions for absolute values and random numbers
#include <iomanip> // Chapter 2 - includes "manipulators" (ex. setprecision)
#include <string> // Chapter 2 - includes functions for strings
#include <fstream> // Chapter 8 - includes functions for streaming I/O data
using namespace std;
int main()
{
string a;
string b;
string c;
cout << "Enter a word: ";//This asks for the first word.
cin >> a;
cout << "Enter a second word: ";// This asks for a second word.
cin >> b;
cout << "Enter a third word: ";// This asks for a third word.
cin >> c;
if (a < b)
{
if (b < c)
{
cout << "The alphabetical order is " << endl;
cout << a << endl << b << endl << c << endl;
}
else
{
if (a < c)
{
cout << "The alphabetical order is " << endl;
cout << a << endl << c << endl << b << endl;
}
else
{
cout << "The alphabetical order is " << endl;
cout << c << endl << a << endl << b << endl;
}
}
}
else
{
if (b < c)
{
cout << "The alphabetical order is " << endl;
cout << b << endl << a << endl << c <<endl;
}
else
{
if (a < c)
{
cout << "The alphabetical order is " << endl;
cout << b << endl << c << endl << a << endl;
}
else
{
cout << "The alphabetical order is " << endl;
cout << c << endl << b << endl << a << endl;
}
}
}
system("pause");
return 0;
}
}
}