C/C++の宿題を片付けます 104代目
at TECH
184:デフォルトの名無しさん
08/02/11 19:38:23
>>180
#include <iostream>
#include <string>
#include <boost/regex.hpp>
int main() {
while (true) {
std::cout << "入力: ";
std::string line;
if (!std::getline(std::cin, line))
break;
boost::regex re_num("\\d+");
if (boost::regex_search(line, re_num)) {
std::cout << "※エラー※数値が入力されました" << std::endl;
std::cout << "もう一度入力してください" << std::endl;
continue;
}
boost::regex re_str("^a+");
std::cout << "出力: "
<< boost::regex_replace(line, re_str, "") << std::endl;
break;
}
}
次ページ続きを表示1を表示最新レス表示スレッドの検索類似スレ一覧話題のニュースおまかせリスト▼オプションを表示暇つぶし2ch
4969日前に更新/299 KB
担当:undef