#include <iostream> // Fine
#include <string> // Fine
#include <set> // Fine
usingnamespace std; // Err...whatever
int main() // Fine
{
string word //, Fine
//temp // Not needed
;
int w; // Could use a more descriptive name, but whatever
cout << "How many words? "; // Fine
cin >> w; // Fine
set<string> words; // Fine
//set<string>::value_compare mycomp = words.value_comp(); // What?
while (w > 0) // Going in reverse order? Whatever
{
cout << "Word # " << w << ": "; // Fine
cin >> word; // Fine
//mycomp(word, temp); // Huh?
//if (word != temp); // What?
words.insert(word); // std::set automatically takes care of the compare for you
w--; // Fine
}
// Everything after this is fine...
cout << "Words:\n";
for (set<string>::const_iterator it = words.begin(); it != words.end(); ++it)
cout << *it << '\n';
//system("pause") // ...except I wouldn't use this.
return 0;
}