Official
B - tcdr Editorial
by
B - tcdr Editorial
by
cn449
初心者の方へ
- プログラミングの学習を始めたばかりで何から手をつけるべきかわからない方は、まずは practice contest の問題A「Welcome to AtCoder」をお試しください。言語ごとに解答例が掲載されています。
- また、プログラミングコンテストの問題に慣れていない方は、 AtCoder Beginners Selection の問題をいくつか試すことをおすすめします。
- C++入門 AtCoder Programming Guide for beginners (APG4b) は、競技プログラミングのための C++ 入門用コンテンツです。
問題文の指示の通りに \(S\) から a
,e
,i
,o
,u
を取り除く、あるいは空文字列に \(S\) の a
,e
,i
,o
,u
以外の文字を順序を保って追加していくことで答えを得ることができます。
実装例
#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()))
posted:
last update: