Commit 4d66494b authored by Elon Bontemps's avatar Elon Bontemps
Browse files

autosave

parent 238c48fd
#include "countries.h"
\ No newline at end of file
#include "countries.h"
#include <iostream> //make a function
#include <utitlity>
#include <string>
#include <map>
#include <ifstream>
using namespace std;
//function returns map of pairs
map<string, pair<double, double>> mapMaker() {
ifstream fin;
fin.open("countries.txt");
//variables
map<string, pair<double, double>> tempMap();
pair<double,double> tempPair;
string placeName;
if(!fin.is_open()) {
cerr << "Error couldn't open file." << endl;
exit(1);
}
while(!fin.eof()) {
getline(fin, placeName, '.');
getline(fin, tempPair.first, '.');
getline(fin, tempPair.second, '\n');
tempMap.emplace(placeName, tempPair);
placeName.clear();
}
return tempMap;
}
\ No newline at end of file
#include <iostream>
\ No newline at end of file
#include <string>
using namespace std;
//functions
//North America
1. Seattle, Washington
2. Boise, Idaho
3. Helena, Montana
4. St. Paul, Minessota
5. Madison, Wisconson
6. New York, New York,
7. Augusta, Maine
Seattle, Washington
Boise, Idaho
Helena, Montana
Saint Paul, Minessota
Madison, Wisconson
New York, New York,
Augusta, Maine
Los-Angeles, California
Salt Lake City, Utah
Topeka, Kansas
......@@ -46,5 +46,7 @@ Busan, South Korea
Nagoya, Japan
//Australia
Kalgorie, Australia
Coober Pedy, South Australia. 231 . 23412
//
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment