C/C++の宿題を片付けます 104代目at TECH
C/C++の宿題を片付けます 104代目 - 暇つぶし2ch184:デフォルトの名無しさん
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