JLOI 提示问题

按照题目意思模拟即可。

 1 Program XJOI2265;
 2 const a:array[1..10] of char=('a','e','i','o','u','A','E','I','O','U');
 3 var s:ansistring;
 4     len,i,j,sum,x,y:longint;
 5     flag:boolean;
 6 function check(ch:char):boolean;
 7 begin
 8     if (ch>='A') and (ch<='Z') or (ch>='a') and (ch<='z') then exit(true); exit(false);
 9 end;
10 function vowel(ch:char):boolean;
11 var i:longint;
12 begin
13     for i:=1 to 10 do if ch=a[i] then exit(true); exit(false);
14 end;
15 begin
16     readln(s);
17     len:=length(s); sum:=0;
18     for i:=1 to len do
19         if check(s[i]) then
20         begin
21             write('.');
22             inc(sum);
23         end
24         else write(s[i]);
25     writeln;
26 //---------------------- the first --------------------------
27     x:=round(sum / 3);
28     for i:=1 to len do
29         if check(s[i]) then
30             if x>0 then
31             begin
32                 write(s[i]);
33                 dec(x);
34                 if x=0 then y:=i;
35             end
36             else write('.')
37         else write(s[i]);
38     writeln;
39 //----------------------- the second -------------------------
40     flag:=false;
41     for i:=y+1 to len do
42         if vowel(s[i]) then
43         begin
44             flag:=true;
45             break;
46         end;
47     for i:=1 to y do write(s[i]);
48     if flag then
49     for i:=y+1 to len do
50         if check(s[i]) then
51             if vowel(s[i]) then write(s[i]) else write('.')
52         else write(s[i])
53     else
54     begin
55         x:=round( sum*2/3)-round(sum/3);
56         for i:=y+1 to len do
57         if check(s[i]) then
58             if x>0 then
59             begin
60                 write(s[i]);
61                 dec(x);
62                 end
63             else write('.')
64         else write(s[i]);
65     end;
66     writeln;
67 //----------------------- the end -------------------------    
68 
69 end.

 

转载于:https://www.cnblogs.com/rpSebastian/p/4219912.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值