| ||||||||||
| 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 | |||||||||
见内,偶把偶2次的输入搞混了...注释掉的是用gets的...汗In Reply To:Re:....哦哦哦,说错了....最后我用的cin...gets()的我是在中间去空格的~不好意思~ Posted by:mixter at 2005-08-31 16:42:09 while(1){
scanf("%s",&s);
char c=getchar();
if(c!=' ')
break;
scanf("%s",&p);
/*gets(s);
//gets(p);
//puts(p);
if(s[0]==0)
break;
else
{
for(int i=0;s[i]!=' ';++i);
s[i]=0;
i++;
for(int j=0;s[i]!=0;++i,++j){
p[j]=s[i];
}
p[j]=0;
}
//puts(s);*/
t.insert(p,s);
}
while(1){
//cout<<s<<endl;
t.trie_search(s);
/*if (t.trie_search(s, entry))
printf("%s\n",entry);
else
printf("eh\n");*/
if(scanf("%s",&s)==EOF)
break;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator