// 22_22-2.cpp : コンソール アプリケーションのエントリ ポイントを定義します。
//

#include "stdafx.h"
#include <iostream>
#include <windows.h>
#include <fstream>
#include <string>

using namespace std;

int _tmain(int argc, _TCHAR* argv[])
{
	ifstream fin;
	ofstream fout;
	string ss;

	fin.open("smp.txt");
	if (!fin) {
		cout << "入力ファイルをオープンできません\n";
		MessageBox(NULL, _T("Check Console Window"), L"MessageBox", MB_OK);
		return 1;
	}
	fout.open("smp2.txt");
	if (!fout) {
		cout << "出力ファイルをオープンできません\n";
		MessageBox(NULL, _T("Check Console Window"), L"MessageBox", MB_OK);
		return 1;
	}

	while (getline(fin, ss)) {
		fout << ss << '\n';
	}

	fin.close();
	fout.close();

	MessageBox(NULL, _T("Check Console Window"), L"MessageBox", MB_OK);

	return 0;
}

