1 #include2 #include 3 #include 4 using namespace std; 5 int a[30]={-1,1,2,3,-1,1,2,-1,-1,2,2,4,5,5,-1,1,2,6,2,3,-1,1,-1,2,-1,2}; 6 char s[25]; int ans[25]; 7 int main(){ 8 while(scanf("%s",s)!=EOF){ 9 int len=strlen(s); int top=-1; bool flag=false;10 for(int i=0;i 0){12 if(top==-1||ans[top]!=a[s[i]-'A']||flag){13 ans[++top]=a[s[i]-'A'];14 flag=false;15 }16 }17 else flag=true;18 for(int i=0;i<=top;i++)19 printf("%d",ans[i]);20 printf("\n");21 }22 return 0;23 }