ACM ZJU 1808
来源:互联网 发布:开淘宝店要求 编辑:程序博客网 时间:2024/05/23 01:59
#include <iostream>
#include <string>
#include <vector>
//#include <algorithm>
using namespace std;
int main()
{
int count = 1;
string s;
while(cin>>s)
{
vector<string> svec;
while(s != "9")
{
svec.push_back(s);
cin>>s;
}
bool tag = false;
for(vector<string>::iterator it = svec.begin(); it != svec.end(); ++it)
{
for(vector<string>::iterator k = (it+1); k != svec.end(); ++k)
{
tag = true;
string s1= *it;
string s2 = *k;
int t1 = s1.size();
int t2 = s2.size();
int minnumber = (t1>=t2 ? t2:t1);
for(int i=0; i<minnumber; ++i)
{
if (s1[i] != s2[i])
{
tag = false;
break;
}
}
if (tag == true)
{
break;
}
}
if (tag == true)
{
break;
}
}
if (tag)
{
cout<<"Set "<<count<<" is not immediately decodable"<<endl;
}
else
{
cout<<"Set "<<count<<" is immediately decodable"<<endl;
}
count++;
}
return 0;
}
#include <string>
#include <vector>
//#include <algorithm>
using namespace std;
int main()
{
int count = 1;
string s;
while(cin>>s)
{
vector<string> svec;
while(s != "9")
{
svec.push_back(s);
cin>>s;
}
bool tag = false;
for(vector<string>::iterator it = svec.begin(); it != svec.end(); ++it)
{
for(vector<string>::iterator k = (it+1); k != svec.end(); ++k)
{
tag = true;
string s1= *it;
string s2 = *k;
int t1 = s1.size();
int t2 = s2.size();
int minnumber = (t1>=t2 ? t2:t1);
for(int i=0; i<minnumber; ++i)
{
if (s1[i] != s2[i])
{
tag = false;
break;
}
}
if (tag == true)
{
break;
}
}
if (tag == true)
{
break;
}
}
if (tag)
{
cout<<"Set "<<count<<" is not immediately decodable"<<endl;
}
else
{
cout<<"Set "<<count<<" is immediately decodable"<<endl;
}
count++;
}
return 0;
}
- ACM ZJU 1808
- zju acm 1622
- acm zju 1712
- ZJU ACM 1004
- ZJU ACM 1005
- zju acm 1007
- acm zju 1698
- ACM ZJU 2104
- CAPTCHA zju 校赛 acm
- acm.zju.3507
- acm.zju.1586
- ACM zju 1003 源代码(参考)
- Jug 倒水问题 ZJU ACM
- ACM大数的高精度模板一套,来自zju
- 第一个zju的acm程序(ID:1001)
- http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3403
- Fire Net from http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=2
- Crashing Balloon from http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=3
- “十一五”我国电子商务发展预测
- Ajax/REST 架构风格对于融入式 Web 应用程序的优点
- ABAP--使用SLIN事务码进行ABAP程序扩展语法检查,提高程序开发的质量
- java Date总结
- 国外一所大学电子商务专业的介绍
- ACM ZJU 1808
- 建议旅游学校开办“旅游电子商务专业”或“旅游电子商务课程”
- 初次写东西
- C# 访问AD中用户信息的几个操作
- MySQL中的时间日期函数
- C/C++输出流写文件的一点误区
- 读Defective C++随笔 3
- 增强Eclipse ,MyEclipse 的代码提示功能
- 程序员内功修炼序列