// 22_22-1.cpp : コンソール アプリケーションのエントリ ポイントを定義します。
//

#include "stdafx.h"
#include <iostream>
#include <windows.h>
#include <fstream>

using namespace std;

int _tmain(int argc, _TCHAR* argv[])
{
	ifstream fin;
	ofstream fout;
	char ch;

	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 (fin.get(ch)) {
		fout.put(ch);
	}

	fin.close();
	fout.close();

	MessageBox(NULL, _T("Check Console Window"), L"MessageBox", MB_OK);

	return 0;

}

