公式

B - tcdr 解説 by en_translator


For beginners


Follow the instructions of the problem statement to remove a, e, i, o, and u from \(S\), or append the characters of \(S\) except for a, e, i, o, and u to an initially empty string, in order to obtain the answer.

Sample code

#include <iostream>
#include <string>
using namespace std;

int main() {
	string s;
	cin >> s;
	string ans = "";
	for (char c : s) if (c != 'a' && c != 'e' && c != 'i' && c != 'o' && c != 'u') ans += c;
	cout << ans << endl;
}
import re
print(re.sub('a|e|i|o|u', '', input()))

投稿日時:
最終更新: