What is wrong with this quiz?
I submited quiz in the quiz factory and it was declined. Not even a single line of explanation was given to me about why it is not exepted. This is quiz: " What is output of this code? #include <iostream> #include <set> #include <iterator> using namespace std; int main() { set<char> name; name.insert('S'); name.insert('o'); name.insert('l'); name.insert('o'); name.insert('L'); name.insert('e'); name.insert('a'); name.insert('r'); name.insert('n'); copy(name.begin(), name.end(), ostream_iterator<char>(cout)); return 0; } " and given variants for answer is: - LSaelnor; - 0; - Sn; - SoloLearn; If you copy this code it will compile and run. And will give you output. Correct answer is: LSaelnor. And this answer was marked like correct in the quiz. So why it is declined? Set - is array of elements which sorted in the rise order by compiler automaticly. Because of numbers from ANSI table of characters: 'L'=76,'S'=83,'a'=97,'e'=101,'l'=108,'n'=110,'o'=111,'r'=114 - as you can see numbers in the ascending order. Also <set> not allow to have repetetive elements, this is why only one 'o' was succesfully inserted. So what is wrong?