C/C++の宿題を片付けます 116代目
at TECH
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