#include <iostream>
#include <vector>
#include <fstream>
using std::cin;
using std::cout;
using std::vector;
using std::ostream;
using std::istream;
using std::ofstream;
using std::ifstream;

struct Point {
	double x, y;
	Point(double x, double y) : x(x), y(y) {}
	Point() {}
};

ostream& operator<<(ostream& ost, const Point& p) {
	ost << '(' << p.x << ',' << p.y << ')';
	return ost;
}

istream& operator>>(istream& ist, Point& p) {
	char c;

	double x, y;
	ist >> c; 
	//if (c != '(') cout << "\nb=" << c;
	ist >> x;
	ist >> c;
	if (c != ',') return ist;
	ist >> y;
	ist >> c;
	if (c != ')') return ist;
	p = Point(x, y);
	return ist;
}

void printPoints(const vector<Point>& vp) {
	for (Point p : vp) cout << p << '\n';
}

int main() {
	cout << "\nEnter 7 x,y pairs: ";
	double x, y;
	vector<Point> original_points;
	for (int i = 0; i < 7; ++i) {
		cin >> x >> y;
		original_points.push_back(Point(x, y));
	}
	printPoints(original_points);
	ofstream ofs("hereDemPoints.txt");
	for (Point p : original_points) 
		ofs << p << '\n';
	ofs.close();
	ifstream ifs("hereDemPoints.txt");
	Point p;
	vector<Point> processed_points;
	while (ifs >> p) processed_points.push_back(p);
	printPoints(processed_points);
	cin.ignore();
	cin.get();
}