1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
#include <iostream>
#include <string>
#include <fstream>
#include <map>
#include <vector>
using namespace std;
int main()
{ string a, b;
ifstream fichier("drugbank_22_02_2012.txt", ios::in);
if(fichier)
{
string ligne;
while(getline(fichier, ligne))
{
cout << ligne << endl;
}
}
else
cerr << "Impossible d'ouvrir le fichier !" << endl;
fichier >> a;
fichier >> b;
map<string, vector<string>> interaction_map;
string i;
using interaction=pair<string,string>interaction i;
while (fichier>i){
interaction_map[i.first].push_back(i.second);
interaction_map[i.second].push_back(i.first);
}
return 0;
} |