C/C++の宿題を片付けます 116代目 at TECH
[2ch|▼Menu]
609:デフォルトの名無しさん
08/10/23 16:03:17
>>603
こんなでいい?
#include<iostream>
#include<fstream>
#include<string>
#include<set>
using namespace std;
typedef set<string> Dictionary;
int main(){
string word;
Dictionary dict;
ifstream ifs("in.txt");
if(!ifs.is_open()) return 1;
while(!ifs.eof()){
ifs >> word;
dict.insert(word);
}
ifs.close();
while(1){
cout << "Search:";
cin >> word;
if(dict.find(word) != dict.end()) cout << "OK!" << endl;
else cout << "Not found." << endl;
}
}


次ページ
続きを表示
1を表示
最新レス表示
スレッドの検索
類似スレ一覧
話題のニュース
おまかせリスト
▼オプションを表示
暇つぶし2ch

4441日前に更新/366 KB
担当:undef