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 <string> using namespace std; int main() { int nvocab=0,len,i,j,k; string temp,vocab[300]; string word,str1; bool found; while(1) { cin>>temp; if(temp=="XXXXXX")break; vocab[nvocab++]=temp; } while(1) { cin >>word; if(word=="XXXXXX")break; len=word.length(); cout<<endl;found=false; for(i=0;i<nvocab;i++) { if(vocab[i].length()==len) { temp=vocab[i]; for(j=0;j<len;j++) { for(k=0;k<len;k++) { if(temp[k]==word[j])temp[k]='1'; } } if(temp==str1.assign("111111",0,len)) { cout<<vocab[i]<<endl; found=true; } } } if(!found)cout<< "NOT A VALID WORD"<<endl; cout<<"******"<<endl; } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator