forked from ngthanhtrung23/CompetitiveProgramming
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathK.pas
More file actions
25 lines (23 loc) · 650 Bytes
/
K.pas
File metadata and controls
25 lines (23 loc) · 650 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
var n, i : integer;
var s : ansistring;
begin
readln(n);
readln(s);
for i := 1 to n do begin
if (s[i] = 'a') or (s[i] = 'e') or (s[i] = 'i') or (s[i] = 'o') or (s[i] = 'u') or (s[i] = 'y') then begin
if (i > 1) and (s[i] = s[i-1]) then begin
if (s[i] = 'e') or (s[i] = 'o') then begin
if (i = 2) or (s[i-2] <> s[i]) then begin
if (i = n) or (s[i+1] <> s[i]) then begin
write(s[i]);
end
end
end
end
else begin
write(s[i]);
end
end
else write(s[i]);
end
end.