#include #include #include int compStrings (const void *s1, const void* s2){ return ((string*)s1)->compare(*((string*)s2)); } int main(){ int dSize; cin >> dSize; // read in dictionary string* dictionary = new string[dSize]; for(int i=0;i> dictionary[i]; // sort dictionary qsort(dictionary, dSize, sizeof(string), compStrings); // read in and check emails int nEmails; cin >> nEmails; for(int i=0;i> word; correct = true; while(word != "-1"){ if(bsearch(&word, dictionary, dSize, sizeof(string), compStrings)==NULL){ if(correct){ cout << "Email "<<(i+1)<<" is not spelled correctly." << endl; correct = false; } cout << word << endl; } cin >> word; } if(correct) cout << "Email "<<(i+1)<<" is spelled correctly." << endl; } cout << "End of Output" << endl; }