#include  < string >
#include 
< vector >
#include 
< algorithm >
#include 
< iostream >

using   namespace  std;

int  main()
{
    
string  str;
    
int     num =   1 ;
    
    
while ( cin  >>  str )
    
{
        vector
< string >   d;
        
if ( str !=   " 9 "  )  d.push_back( str );
        
        
while ( cin  >>  str   &&   str !=   " 9 "  )  d.push_back( str );
        
        sort( d.begin(), d.end() );
        
bool  isok =   false ;
        
for ( size_t i =   1 ; i <  d.size();  ++ i )
             
if ( d[i].find( d[i - 1 ] ) !=   string ::npos ) {
                    isok
=   true ;   break ; }

                    
        
if ! isok ) cout  <<   " Set  "   <<  num ++   <<   "  is immediately decodable "   <<  endl;
        
else         cout  <<   " Set  "   <<  num ++   <<   "  is not immediately decodable "   <<  endl;
    }

    
    
return   0 ;
}

posted on 2008-10-30 20:03 Darren 阅读(376) 评论(0)  编辑 收藏 引用 所属分类: 未分类

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理