杭电1039 Easier Done Than Said?

『杭电1039』Easier Done Than Said? Problem Description Password security is a tricky thing. Users prefer simple passwords that are easy to remember (like buddy), but such passwords are often insecure. Some sites use random computer-generated passwords (like xvtpzyo), but users have a hard 阅读详情

Easier Done Than Said?

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 10540    Accepted Submission(s): 5090


Problem Description
Password security is a tricky thing. Users prefer simple passwords that are easy to remember (like buddy), but such passwords are often insecure. Some sites use random computer-generated passwords (like xvtpzyo), but users have a hard time remembering them and sometimes leave them written on notes stuck to their computer. One potential solution is to generate "pronounceable" passwords that are relatively secure but still easy to remember.

FnordCom is developing such a password generator. You work in the quality control department, and it's your job to test the generator and make sure that the passwords are acceptable. To be acceptable, a password must satisfy these three rules:

It must contain at least one vowel.

It cannot contain three consecutive vowels or three consecutive consonants.

It cannot contain two consecutive occurrences of the same letter, except for 'ee' or 'oo'.

(For the purposes of this problem, the vowels are 'a', 'e', 'i', 'o', and 'u'; all other letters are consonants.) Note that these rules are not perfect; there are many common/pronounceable words that are not acceptable.
 

Input
The input consists of one or more potential passwords, one per line, followed by a line containing only the word 'end' that signals the end of the file. Each password is at least one and at most twenty letters long and consists only of lowercase letters.
 

Output
For each password, output whether or not it is acceptable, using the precise format shown in the example.
 

Sample Input
  
a tv ptoui bontres zoggax wiinq eep houctuh end
 

Sample Output
  
<a> is acceptable. <tv> is not acceptable. <ptoui> is not acceptable. <bontres> is not acceptable. <zoggax> is not acceptable. <wiinq> is not acceptable. <eep> is acceptable. <houctuh> is acceptable.
 

Source
 

Recommend
We have carefully selected several similar problems for you:   1062  1073  1043  1113  1075 
 


至少有一个元音字母。

不能有三个连续的元音字母或三个连续的辅音字母。

不能有两个连续的相同的字母,除了ee和oo

附代码:

#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
char s[220];
int judge(char c)
{
	if(c=='a'||c=='e'||c=='i'||c=='u'||c=='o')
	return 1;
	return 0;
}
int i,j,k,l,m,n,flag;
int main()
{
	while(scanf("%s",s)&&strcmp(s,"end\0")!=0)
	{
		flag=1;
		m=0;
		l=strlen(s);
		for(i=0;i<l;i++)
		if(judge(s[i]))
		m++;
		if(m==0)
		flag=0;
		for(i=0;i<l-2;i++)
		if((judge(s[i])&&judge(s[i+1])&&judge(s[i+2]))||(!judge(s[i])&&!judge(s[i+1])&&!judge(s[i+2])))
		flag=0;
		for(i=0;i<l-1;i++)
		if(s[i]==s[i+1]&&(s[i]!='o'&&s[i]!='e'))
		flag=0;
		if(flag)
		printf("<%s> is acceptable.\n",s);
		else
		printf("<%s> is not acceptable.\n",s);
	}
}


工业通信协议详解:从Modbus到OPC UA,数据采集的桥梁 在工业数据采集中,通信协议是设备与上位机之间无形的语言桥梁。从RS485串口到工业以太网,从Modbus轮询到OPC UA语义化订阅,协议决定了现场设备产生的数据能否被正确解析和传输。理解物理层、报文层与应用层的三层约定,是定位数据采集疑难杂症的基础。主流协议各有适用场景:Modbus适合仪表与小型PLC,PROFINET满足微秒级运动控制,OPC UA擅长跨系统语义集成,MQTT则面向工业物联网平台对接。选型时需综合设备接口、实时性要求与点位规模,并警惕字节序反转、寄存器地址偏移等典型陷阱。掌握协议生态和 阅读详情

相关推荐

西门子交换机环网冗余设置(实战篇2.2)

MRP的重组时间为 200ms 因此 PROFINET 通信必须选择大于 200ms 的看门狗时间,看门狗。ET200SP默认为 2ms*3=6ms) MRP 的重组时间为 200ms 故系统会报出看门狗超时。更新,默认是 3 个周期,超出设置的周期数就会报 IO 设备故障。时间不是直接配置的,而是作为没有 IO 数据可接受的更新周期,也就是允许几个周期没有数据。来达到大于 200ms 的看门狗时间的要求(看门狗时间 可接受更新周期数 更新时间)。是IO 控制器和 IO 设备)

weixin_42580591的博客 375

杭电ACM OJ 1039 Easier Done Than Said? 水(但是很好玩的一道题,考察逻辑思维)

Easier Done Than Said? Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 14426    Accepted Submission(s): 6986 Problem Description Pa

qq_36523667的博客 736

MTK平台高效部署Qwen2.5大模型:从转换到推理全流程解析

本文详细解析了在MTK平台上高效部署Qwen2.5大模型的全流程,涵盖从环境准备、模型转换与量化,到编译部署与上机推理。重点介绍了如何利用MTK GAI部署工具包进行模型转换和量化,以适配MTK硬件,并最终在设备上成功运行Qwen2.5模型,为边缘侧AI应用提供实践指南。

weixin_29041195的博客 516

杭电OJ-1039(C)

#include <stdio.h> #include <string.h> int is_vowel(char ch) { switch(ch) { case 'a': return 1;break; case 'e': return 2;break; case 'i': return 3;break; case 'o': return 4;break...

qq_40467670的博客 329

SAP-MM-PR分配货源并转PO

SAP-MM-PR分配货源并转PO

yanzibing99的博客 5481

基于FPGA的CORDIC算法实现——Verilog版

目前,学习与开发FPGA的程序员们大多使用的是Verilog HDL语言(以下简称为Verilog),关于Verilog的诸多优点一休哥就不多介绍了,在此,我们将重点放在Verilog的运算操作上。 我们都知道,在Verilog中,运算一般分为逻辑运算(与或非等)与算术运算(加减乘除等)。而在一开始学习Verilog时,老司机一定会提醒我们,“切记,千万别用‘/’除、‘%’取模(有的也叫取余)和‘

善良の一休君的博客 6万+

杭电ACM1039——Easier Done Than Said?

这一题,简单的字符串处理。只是题目的要求比较麻烦。 题目的大概意思是:给你一段字符串,判断是否可以被接受。 判断的条件为: 1.存在一个元音。(元音有a,e,i,o,u) 2.不能有连续的三个元音或者连续的三个非元音。 3.不能有连续的两个相同字符除了e和o可以之外 有了这些条件,就很容易了。 下面的是一次AC的代码,有详细的注释: #include #include usin

XD 1015

龙头复盘神器/复盘于导出工具最新版5.6

龙头复盘神器,复盘于导出工具

初入python踩过的坑 8276

杭电OJ 1039(C++)

#include <iostream> #include <string> #include <cstring> using namespace std; int main() { string str; //字符串 while (cin >> str) { if (str == "end") break; int len =...

Intelligence1028的博客 382

【基础-多选】HarmonyOS鸿蒙应用开发

1、HarmonyOS提供了基础的应用加固安全能力,包括混淆、加密和代码签名能力。正确2、可以通过ohpm uninstall 指令下载指定的三方库。错误3、支持模块化开发是指一个应用通常会包含多种功能,将不同的功能特性按模块来划分和管理是一种良好的设计方式。在开发过程中,我们可以将每个功能模块作为一个独立的Module进行开发,Module中可以包含源代码、资源文件、第三方库、配置文件等,每一个Module可以独立编译,实现特定的功能。这种模块化、松耦合的应用管理方式有助于应用的开发、维护与扩展。正确。

江拥羡橙的博客 1万+

UNet 改进(22):结合Transformer结构

保留了UNet的经典编码器-解码器结构在瓶颈层使用Transformer替代传统的卷积层采用跳跃连接保持空间细节信息使用双卷积块(DoubleConv)作为基础构建模块。

2401_82355416的博客 779

杭电ACM1020 VS 1039

1020题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1020 1039题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1039 其实两个题是类似的,都是给一个字符串,检测连续的重复字符的子串。不过1039的附加条件更多 //1020的代码 #include #include char s

kay_zhyu的专栏 1031

【Matlab】matlab代码实现迭代学习控制

该文介绍了在Matlab中实现迭代学习控制(ILC)的方法。ILC通过利用历史轨迹数据来优化重复任务的控制性能。文章提供了一个步进电机控制示例,包括:1)定义正弦轨迹;2)设置100次迭代和0.1学习率;3)建立二阶系统模型;4)执行ILC算法计算控制输入;5)绘制期望轨迹与实际输出的对比图。该示例展示了ILC的基本实现过程,并指出实际应用可能需要更复杂的设计。代码演示了误差计算、控制输入更新和结果可视化等关键步骤。

unber的博客 208

Easier Done Than Said?(杭电oj1039)

Easier Done Than Said? Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 8339    Accepted Submission(s): 4093 Problem Description Pas

My Castle 1033

efm32 入门.pdf

本PDF共计22页,介绍的是操作驱动API,下载与否自己斟酌。

文档:亲测可用解决vnc灰屏,黑屏,鼠标大黑叉情况

主要解决vnc-viewer灰屏,黑屏,鼠标大黑叉等现象,详细见文档。

杭电1039 之 Easier Done Than Said?

Problem Description Password security is a tricky thing. Users prefer simple passwords that are easy to remember (like buddy), but such passwords are often insecure. Some sites use random computer-ge

ESESZB的博客 516

全球国家地区城市数据

MySQL全球国家地区城市数据报。。。。。。。。。。。。

杭电ACM HDOJ 1039 Easier Done Than Said?

Easier Done Than Said? Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 6387    Accepted Submission(s): 3172 Problem Description Passw

gubojun的专栏 1349

pscad IEEE标准系统搭建说明

pscad IEEE标准系统搭建说明,包含典型的IEEE 9节点、14节点、30节点、39节点和118节点系统。内含标准测试系统的原始数据和潮流结果。

杭电 HDU 1039 Easier Done Than Said?

Easier Done Than Said? Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 9231    Accepted Submission(s): 4503 Problem Description Passwor

舒哥的blog 1074

杭电OJ——1039 Easier Done Than Said?(水题)

Easier Done Than Said? Problem Description Password security is a tricky thing. Users prefer simple passwords that are easy to remember (like buddy), but such passwords are often insecure. Som

李树花开,风中摇曳 2366

Easier Done Than Said?杭电ACM1039

Easier Done Than Said? Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 12815    Accepted Submission(s): 6188 Problem Description Passwo

Ordinary programmer 628

Easier Done Than Said? 【杭电-1039】 附题

/* Easier Done Than Said? Problem DescriptionPassword security is a tricky thing. Users prefer simple passwords that are easy to remember (like buddy), but such passwords are often insecure. Some

Fighting_Dream 1131

HDU杭电 1039 Easier Done Than Said?(字符串问题)

Problem Description Password security is a tricky thing. Users prefer simple passwords that are easy to remember (like buddy), but such passwords are often insecure. Some sites use random computer-ge

Scarlett_geng的博客 588

杭电ACM1039 Easier Done Than Said?

为了方便起见,我设置了三个标志位来判断输入的数据是否符合三个规则。#include &lt;iostream&gt;#include &lt;stack&gt;#include &lt;cstdio&gt;#include &lt;string.h&gt;using namespace std;char a[100];int flag1=0;//1为符合规则int flag2=1;int flag...

heiyiming123的博客 214

HDOJ 1039 Easier Done Than Said?解题报告

<br />#include <stdio.h> #include <memory.h> #include <bitset> using namespace std; int main() { char str[22]; bool flag; bitset<20> sign

冰枫的随笔 992

Problem C : Easier Done Than Said?

Problem C : Easier Done Than Said? From: HDU, 1039 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Problem Description Password security is a tricky thing. Users prefer simple passwords that are easy to remember (like

weixin_52963988的博客 165

HDU 1039 Easier Done Than Said?(简单题)

Easier Done Than Said? Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 3965    Accepted Submission(s): 1999 Problem Description Password secu...

weixin_33831673的博客 103

hdu-1039-Easier Done Than Said?

Easier Done Than Said? Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 14313 Accepted Submission(s): 6934 Problem Description Password s

暗淡的时光 787
上一篇: 杭电1046
下一篇: 杭电1036 Average is not Fast Enough!
hpuzsk
博客等级 码龄11年 118粉丝 342原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值