Official
B - tcdr Editorial by en_translator
For beginners
- If you are new to learning programming and do not know where to start, please try Problem A "Welcome to AtCoder" from practice contest. There you can find a sample code for each language.
- Also, if you are not familiar with problems in programming contests, we recommend you to try some problems in "AtCoder Beginners Selection".
- 「C++入門 AtCoder Programming Guide for beginners (APG4b)」 is a C++ tutorial for competitive programmers. Sadly, this is only in Japanese too.
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()))
posted:
last update: