Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as C++ by Volodia2940544 ( 17 years ago )
#include<iostream>
#include<fstream>
#include<cstdlib>
const int size=200;

int main()
{
 using namespace std;
char mas[size];
ifstream mfile&#40;"TXT.txt"&#41;;
if(!mfile.is_open())
cout<<"huynja poluchylash(((";
int i=0;
char ch;
mfile.get(ch);
while(ch!='.')
{
cout<<ch;
 mas[i]=ch;
 mfile.get(ch);
 i++;
}
cout<<endl;

 mfile.close();
 
 for(int l=0;l<i;l++)
 {if(mas[l]=='a' && mas[l+1]=='b' && mas[l+2]=='c')
 {mas[l]='d';
 mas[l+1]='e';
 mas[l+2]='f';}
 
 }
 cout<<endl;
cout<<"a ce fajl zminenyj : "<<endl<<endl;
for(int k=0;k<i;k++)
cout<<mas[k];
ofstream nfile&#40;"TXT.txt"&#41;;
nfile<<"zmineny fayl : "<<endl<<endl;
for(int k=0;k<i;k++)
nfile<<mas[k];
nfile.close();

 cin.get();
 return 0;
}

 

Revise this Paste

Your Name: Code Language: