Advertisement
Guest User

Untitled

a guest
Nov 20th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.67 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. #include <string>
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     ifstream labki;
  9.     ofstream dupa;
  10.     string mati;
  11.     labki.open("Text.txt");
  12.     char c, a, t;
  13.     char d;
  14.     int CAT = 0;
  15.     int pozycja;
  16.     dupa.open("Text1.txt");
  17.     while (labki.get(d))
  18.     {
  19.         if (d == 'C')
  20.         {
  21.             dupa.put('B');
  22.         }
  23.         else
  24.         {
  25.             dupa.put(d);
  26.         }
  27.     }
  28.     labki.close();
  29.     labki.open("Text.txt");
  30.     while (labki.get(c))
  31.     {
  32.        
  33.             if (c == 'C')
  34.             {
  35.                 labki.get(a);
  36.                 if (a == 'A')
  37.                 {
  38.                     labki.get(t);
  39.                     {
  40.                         if (t == 'T')
  41.                         {
  42.                             CAT++;
  43.                         }
  44.                     }
  45.                 }
  46.             }
  47.     }
  48.  
  49.  
  50.     dupa.close();
  51.     labki.close();
  52.     cout << CAT;
  53.     return 0;
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement