Codeforces 118A String Task
阿新 • • 發佈:2018-06-18
remove code begin 鏈接 技術分享 Go mov cout ace
題目鏈接
http://codeforces.com/problemset/problem/118/A
#include<iostream> #include<string> #include<cctype> #include<algorithm> using namespace std; int main() { string str; cin>>str; int i; //將代碼變成小寫 transform(str.begin(), str.end(), str.begin(), ::tolower);//移除特定的字符串 str.erase(std::remove(str.begin(), str.end(), ‘a‘), str.end()); str.erase(std::remove(str.begin(), str.end(), ‘e‘), str.end()); str.erase(std::remove(str.begin(), str.end(), ‘i‘), str.end()); str.erase(std::remove(str.begin(), str.end(), ‘o‘), str.end()); str.erase(std::remove(str.begin(), str.end(),‘u‘), str.end()); str.erase(std::remove(str.begin(), str.end(), ‘y‘), str.end()); int len=str.length(); for(i=0;i<len;i++) { cout<<"."<<str[i]; } return 0; }
Codeforces 118A String Task