1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
|
#include <iostream>
#include <cstdlib>
#include <ctime>
#include <algorithm>
const std::string serial[26] = {
"Back Alley", "Railroad", "Uptown", "Bay Harbor",
"Circus", "Carpool", "Meat Locker", "Flophouse", "Igloo", "Boxcar",
"Outback", "Watchtower", "Playground", "Conservatory",
"Delicatessen", "Beach House", "Backstage", "Ice Truck", "Garage Sale",
"Box Factory", "Hangar", "Swamp", "Nursery", "Strip Mall", "Octagon",
"Kitchen"
};
const std::string killer[26] = {
"Strangler", "Tickler", "Slicer", "Slasher",
"Stabber", "Hacker", "Smasher", "Mangler", "Flayer", "Smotherer",
"Skinner", "Pickler", "Chomper", "Butcher", "Peeler", "Disemboweler", "Cutter",
"Killer", "Asphyxiator","Chef", "Diner", "Monster", "Boiler", "Pounder",
"Collector", "Keeper"
};
int main()
{
std::string input;
bool bGood = false;
while (bGood == false) {
std::cout << "Enter your name: ";
std::getline(std::cin, input);
{
int space_count = 0;
for (std::string::iterator it = input.begin(); it != input.end(); ++it) {
if ((*it) == ' ') ++space_count;
}
if (space_count < 1) {
std::cout << "Only one name entered. Enter first and last." << std::endl;
continue;
}
}
std::transform(input.begin(), input.end(), input.begin(), ::tolower);
if ((input.front() < 'a' || input.front() > 'z') && input.back() < 'a' || input.back() > 'z') {
std::cout << "Invalid name. Please try again." << std::endl;
}
else bGood = true;
}
std::cout <<
serial[input.front() - 'a']
<< " " <<
killer[input.back() - 'a']
<< std::endl;
}
|