-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
34 lines (25 loc) · 773 Bytes
/
main.cpp
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
#include <iostream>
#include <fstream>
#include <unordered_map>
/*
TODO
- HashTable to store every individual ingredient
- Add one count to the ingredient per like and remove one per dislike
*/
std::string INPUT_FILE = "../Input/a_an_example.in.txt";
struct Ingredient {
std::string name;
int likedness = 0;
};
int main() {
std::unordered_map<std::string, Ingredient> ingredientsMap;
std::ifstream inputFile;
inputFile.open(INPUT_FILE);
std::string mystring;
if ( inputFile.is_open() ) { // always check whether the file is open
inputFile >> mystring; // pipe file's content into stream
std::cout << mystring; // pipe stream's content to standard output
}
inputFile.close();
return 0;
}