Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
哪位大牛帮我找找错误啊。#include <iostream> #include <set> #include <string> #include <vector> using namespace std; void main() { set<string> dics; int num; cin>>num; int i; for ( i = 0 ; i < num; i ++ ) { string name; cin>>name; dics.insert(name); } cin>>num; for ( i = 0 ; i < num; i++ ) { vector<string> errorWord; string word; cin>>word; while ( word.compare("-1") != 0 ) { set<string>::iterator itor = dics.find(word); if ( itor == dics.end()) { errorWord.push_back(word); } cin>>word; } if ( errorWord.empty()) { printf("Email %d is spelled correctly.\n",i + 1); } else { printf("Email %d is not spelled correctly.\n",i + 1); for ( vector<string>::iterator itor = errorWord.begin(); itor != errorWord.end(); itor ++ ) { cout<<*itor<<endl; } } cout<<"End of Output"<<endl; } } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator