
#include <iostream>
#include <string>
#include <cstdlib>
#include <ctime>
using namespace std;

string get_random_name(string arr[], int& nums)
{
    int num = rand() % nums;
    string name = arr[num];
    arr[num] = arr[nums - 1];
    --nums;
    return name;


}

int main()
{
    
    string num_names[6];
    int num_of_names = 0;
    int seed;
    int N = 6;

    cout << "== Who Should I Text? ==" << endl;
    cout << "Enter seed" << endl;
    cin >> seed;
	srand(seed);
    while(std::cout << "Enter friend " << num_of_names << endl,
          std::cin  >> num_names[num_of_names])
    {
    	++num_of_names;
    }


    cout << "You should text: " << get_random_name(num_names, num_of_names) << endl;

    cout << "These other friends didn't make the cut:" << endl;

    for (int i = 0; i < num_of_names; ++i)
    {
        cout << num_names[i] << endl;
    }
    return 0;

}
