C/C++の宿題片付けます 128代目
at TECH
108:デフォルトの名無しさん
09/06/27 16:01:45
>>107
眠りながら適当に書いた
#include<iostream>
#include<algorithm>
#include<string>
#include<cctype>
#include<functional>
int main(){
std::string line;
getline(std::cin,line);
std::string tmp = line;
tmp.erase(std::remove_if(tmp.begin(),tmp.end(),std::not1(std::ptr_fun(std::isalpha))),tmp.end());
std::transform(tmp.begin(),tmp.end(),tmp.begin(),std::toupper);
std::cout << (std::equal(tmp.begin(),tmp.end(),tmp.rbegin()) ? "回文です" : "回文じゃないです") << std::endl;
}
次ページ続きを表示1を表示最新レス表示スレッドの検索類似スレ一覧話題のニュースおまかせリスト▼オプションを表示暇つぶし2ch
5079日前に更新/375 KB
担当:undef