Advertisement
Guest User

Untitled

a guest
Dec 1st, 2015
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. #include <conio.h>
  2. #include <iostream>
  3. #include <fstream>
  4. #include <string.h>
  5.  
  6. using std::cout;
  7. using std::cin;
  8. using namespace std;
  9.  
  10. class Task1
  11. {
  12. private:
  13. int i,z;
  14. char x[15][3];
  15. char y[15][3];
  16. public:
  17. void open();
  18. void izm();
  19. };void Task1::open()
  20. {i=0;
  21. ofstream file("sample.txt", ios::out);
  22. if (!(file.eof()))
  23. {file>>x[i];
  24. i++;
  25. }
  26.  
  27. n=i-1;
  28. for (i=0; i<n; i++)
  29.  
  30. if (x[i]=="sample")
  31. file<<"plus";
  32.  
  33.  
  34.  
  35.  
  36. //for (i=0; i<strlen(x); i++)
  37. //{
  38. // if (x=="sample")
  39. // file<<"plus";
  40. // else
  41. // file<<x;
  42. //}
  43. file.close();
  44. system("pause");
  45. };
  46. int main()
  47. {
  48. Task1 k;
  49. k.open();
  50. getch();
  51. return 0;
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement