Example #1
0
/// Author Jared Mavis
/// Username jmavis
/// Code Eval Closest Pair
/// Will read in a set of pairs and will return the closest distance
int main (int argc, char* argv[]){
	ifstream file;
	file.open(argv[1]);
	string lineBuffer;

	while (!file.eof()) {
		getline(file, lineBuffer);
		if (lineBuffer.length() == 0){
			continue; //ignore all empty lines
		} else {
			int setSize = atoi(lineBuffer.c_str());
			PointList pointList;
			if (setSize == 0) break;
			while (!file.eof() && setSize > 0){
				getline(file, lineBuffer);
				InsertLine(pointList, lineBuffer);
				setSize--;
			}
			pointList.PrintMinimum();
		}
	}
}