Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2018
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.23 KB | None | 0 0
  1. //.h file code:
  2.  
  3. #include <string>
  4. #include <vector>
  5. #include <iostream>
  6.  
  7.  
  8. namespace a637
  9. {
  10.     class Program
  11.     {
  12.         static void Main(std::vector<std::wstring> &args);
  13.     };
  14. }
  15.  
  16. //.cpp file code:
  17.  
  18. namespace a637
  19. {
  20.  
  21.     void Program::Main(std::vector<std::wstring> &args)
  22.     {
  23.         Random *ran = new Random();
  24.         std::wstring output = L"";
  25.         std::wstring input = File::ReadAllText(L"637.txt");
  26.         std::vector<wchar_t> input_array = input.ToCharArray();
  27.         for (int i = 0; i < input_array.size(); i++)
  28.         {
  29.             if (input_array[i] == L'A')
  30.             {
  31.                 int tmp = ran->Next(0, 4);
  32.                 for (int j = 0; j < tmp; j++)
  33.                 {
  34.                     output += L"A";
  35.                 }
  36.             }
  37.             else if (input_array[i] == L'C')
  38.             {
  39.                 int tmp = ran->Next(0, 9);
  40.                 for (int j = 0; j < tmp; j++)
  41.                 {
  42.                     output += L"C";
  43.                 }
  44.             }
  45.             else if (input_array[i] == L'G')
  46.             {
  47.                 int tmp = ran->Next(0, 10);
  48.                 for (int j = 0; j < tmp; j++)
  49.                 {
  50.                     output += L"G";
  51.                 }
  52.             }
  53.             else if (input_array[i] == L'T')
  54.             {
  55.                 int tmp = ran->Next(0, 10);
  56.                 for (int j = 0; j < tmp; j++)
  57.                 {
  58.                     output += L"T";
  59.                 }
  60.             }
  61.             else
  62.             {
  63.  
  64.             }
  65.         }
  66.         std::vector<wchar_t> output_array = output.ToCharArray();
  67.         std::wcout << output;
  68.         std::getwchar();
  69.     }
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement