Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <conio.h>
- #include <iostream>
- #include <fstream>
- #include <string.h>
- using std::cout;
- using std::cin;
- using namespace std;
- class Task1
- {
- private:
- int i,z;
- char x[15][3];
- char y[15][3];
- public:
- void open();
- void izm();
- };void Task1::open()
- {i=0;
- ofstream file("sample.txt", ios::out);
- if (!(file.eof()))
- {file>>x[i];
- i++;
- }
- n=i-1;
- for (i=0; i<n; i++)
- if (x[i]=="sample")
- file<<"plus";
- //for (i=0; i<strlen(x); i++)
- //{
- // if (x=="sample")
- // file<<"plus";
- // else
- // file<<x;
- //}
- file.close();
- system("pause");
- };
- int main()
- {
- Task1 k;
- k.open();
- getch();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement