#include <iostream>
#include <string>
#include <vector>
#include <algorithm>

using std::cout;
using std::cin;
using std::endl;
using std::string;
using std::swap;

struct studentStruct {                                                                                                                      
  string firstName;
  //string lastName;
  //int grade;
  //float GPA;
};

enum sortField {eFirstName, eLastName, eGrade, eGPA};                                                                                                   
enum sortDirection {eAscending, eDescending};

bool compData( studentStruct s1, studentStruct s2,  sortField field, sortDirection direction)
{
  switch(field)
    {
    case eFirstName:
      {
        string f1 = s1.firstName;
        string f2 = s2.firstName;
		switch(direction)
		{
			case eAscending:
			{
				if(f2 < f1)
					return true;
				else	
					return false;
			}
			case eDescending:
			{
				if(f2 > f1)
					return true;
				else	
					return false;
			}
		}
      }
    }
}

void sort( studentStruct s[], enum sortField field, int length, sortDirection d)
{
  for(int i = 0; i < length - 1; i++)
    {
      for(int j = 0; j < length - 1 - i; j++)
        {
          if(compData(s[j], s[j+1], field, d) == true)
            {
              swap(s[j], s[j+1]);
              cout << "SWAP" << endl;
            }
        }
    }
}


int main()
{
	struct studentStruct s[5] = {{"M"}, {"I"}, {"K"}, {"O"}, {"N"}};
	 sort(s, eFirstName, 5, eAscending);
	 for(int i = 0; i < 5; i++)
		 cout << s[i].firstName << endl;
}