out

out


#include <iostream>

#include <fstream>

#include <string.h>

#include <windows.h>

#include <conio.h>

using namespace std;

int main()

{

   SetConsoleCP(1251);

   SetConsoleOutputCP(1251);

   ifstream f("c:/temp/1.txt", ios_base::in);

   ofstream f2("c:/temp/2.txt", ios_base::out);

   char s[255];

   int n;

   while (!f.eof())

   {

      f.getline(s, 255);

      n = strlen(s);

      for (int i = 0; i < n; i++)

         if (s[i] == 'D') s[i] = 'A';

      cout << s << endl;

      f2 << s << endl;

   }

   f.close();

   f2.close();

   system("pause");

}


Report Page