PersonalCorpus 版 (精华区)
1148101 Big Guava ... 200 Accepted
0:00.000 64 2002/10/05 20:14:01.532
bool dl[26][26],used[26];
#include "graph.c"
void main()
{
#ifndef ONLINE_JUDGE
freopen("c:\\0acm\\uva\\i200","r",stdin);
freopen("c:\\0acm\\uva\\o200","w",stdout);
#endif
char s[30],t[30];
int i,j,k;
memset(dl,0,sizeof(dl));
memset(used,1,sizeof(used));
gets(s);
for (i=0;s[i]!=0;i++) used[s[i]-65]=false;
while (1) {
gets(t);
if ((t[0]=='#')&&(t[1]==0)) break;
for (i=0;t[i]!=0;i++) used[t[i]-65]=false;
for (i=0;(s[i]==t[i])&&(s[i]!=0)&&(t[i]!=0);i++);
if ((s[i]!=0)&&(t[i]!=0)) dl[s[i]-65][t[i]-65]=true;
strcpy(s,t);
}
while (1) {
i=func1(26);
if (i==-1) break;
printf("%c",i+65);
}
printf("\n");
}
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:3.423毫秒