Sorry, your browser cannot access this site
This page requires browser support (enable) JavaScript
Learn more >

题目描述

image-20250326140242162

思路

代码

Python

1
2
3
4
5
6
7
8
9
10
11
12
13
14
word = input()

V = ["A", "O", "Y", "E", "U", "I"]

# deletes all the vowels
word = ''.join(c for c in word if c.upper() not in V)

# replaces all uppercase consonants with corresponding lowercase ones.
word = word.lower()

# inserts a character "." before each consonant,
word = ''.join('.' + c for c in word)

print(word)

优化:

1
2
3
4
5
word = input()

V = ["A", "O", "Y", "E", "U", "I"]

print(''.join('.' + c.lower() for c in word if c.upper() not in V))

C

1

C++

1