Initial commit

This commit is contained in:
Michael Reber
2019-11-15 12:59:38 +01:00
parent 40a414d210
commit b880c3ccde
6814 changed files with 379441 additions and 0 deletions
@@ -0,0 +1,30 @@
A map of word opposites, using strings.
#include <iostream>
#include <map>
#include <string>
using namespace std;
int main()
{
map<string, string> mapObject;
int i;
mapObject.insert(pair<string, string>("yes", "no"));
mapObject.insert(pair<string, string>("up", "down"));
mapObject.insert(pair<string, string>("left", "right"));
mapObject.insert(pair<string, string>("good", "bad"));
string s;
cout << "Enter word: ";
cin >> s;
map<string, string>::iterator p;
p = mapObject.find(s);
if(p != mapObject.end())
cout << "Opposite: " << p->second;
else
cout << "Word not in map.\n";
return 0;
}