第16週読解プログラム2

959 ワード

/* 
*              
* Copyright (c)2013,             
* All rightsreserved. 
*     :    .cpp 
*    :    
*     :2013  06 14  
*    : v1.0 
*              :  
*     :  
*     :  
*/  
#include <iostream>
#include <fstream>
#include<cstring>
using namespace std;
int main()
{
    ifstream readFile;
    ofstream writeFile;
    char ch[100];
    readFile.open("a.txt", ios::in);
    writeFile.open("b.txt", ios::out);
    while (!readFile.eof())
    {
        readFile.getline(ch,100,'
'); writeFile.write(ch,strlen(ch)); writeFile.write("
",1); } readFile.close(); writeFile.close(); cout << "Finish!" << endl; return 0; }

実行結果: