JLOI 提示问题
2024-10-10 11:15:44
按照题目意思模拟即可。
Program XJOI2265;
const a:array[..] of char=('a','e','i','o','u','A','E','I','O','U');
var s:ansistring;
len,i,j,sum,x,y:longint;
flag:boolean;
function check(ch:char):boolean;
begin
if (ch>='A') and (ch<='Z') or (ch>='a') and (ch<='z') then exit(true); exit(false);
end;
function vowel(ch:char):boolean;
var i:longint;
begin
for i:= to do if ch=a[i] then exit(true); exit(false);
end;
begin
readln(s);
len:=length(s); sum:=;
for i:= to len do
if check(s[i]) then
begin
write('.');
inc(sum);
end
else write(s[i]);
writeln;
//---------------------- the first --------------------------
x:=round(sum / );
for i:= to len do
if check(s[i]) then
if x> then
begin
write(s[i]);
dec(x);
if x= then y:=i;
end
else write('.')
else write(s[i]);
writeln;
//----------------------- the second -------------------------
flag:=false;
for i:=y+ to len do
if vowel(s[i]) then
begin
flag:=true;
break;
end;
for i:= to y do write(s[i]);
if flag then
for i:=y+ to len do
if check(s[i]) then
if vowel(s[i]) then write(s[i]) else write('.')
else write(s[i])
else
begin
x:=round( sum*/)-round(sum/);
for i:=y+ to len do
if check(s[i]) then
if x> then
begin
write(s[i]);
dec(x);
end
else write('.')
else write(s[i]);
end;
writeln;
//----------------------- the end ------------------------- end.
最新文章
- pyqt5-为QListWidget添加右键菜单
- poj 3621 二分+spfa判负环
- Java面向对象:接口
- 关于 android 开发中 debug不能顺利进行的各种问题的总结
- 【android-tips】如何在view中取得activity对象
- Python开发【第八章】:Socket
- 传递给后台的Json数据解析
- Java集合类源码分析
- Python命令行解析库argparse
- AJAX全套
- CQRS学习——最小单元的Cqrs(CommandEvent)[其一]
- Struts2的工作流程
- OC5_构造方法与self指针
- linux下显卡信息的查看
- .NET知识点总结一(笔记整合)
- C#连接六类数据库的代码集
- [转]MySQL修改时区的方法小结
- 【Ansible 文档】配置
- MATLAB遍历文件夹下所有文件
- R语言数据整理