#include <iostream>
#include <string>
#include <cstdio>
#include <string.h>
#include <ctype.h>
using namespace std;
#define MAXN 10 + 5
string str;
string in[MAXN];
void input()
{
int tot = 0, k = 0;
while (getline(cin, str))
{
if (str[0] == '9')
{
bool flag = true;
for (int i = 0; i < tot; i++)
{
for (int j = 0; j < tot; j++)
{
if (i == j)
{
continue;
}
int temp = in[j].find(in[i]);
if (temp == 0)
{
flag = false;
break;
}
}
if (!flag)
{
break;
}
}
if (flag)
{
cout << "Set " << ++k <<" is immediately decodable" << endl;
}
else
{
cout << "Set " << ++k <<" is not immediately decodable" << endl;
}
tot = 0;
}
else
{
in[tot++] = str;
}
}
}
int main()
{
input();
return 0;
}
ACM->uva644
最新推荐文章于 2018-06-08 22:12:34 发布