Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //.h file code:
- #include <string>
- #include <vector>
- #include <iostream>
- namespace a637
- {
- class Program
- {
- static void Main(std::vector<std::wstring> &args);
- };
- }
- //.cpp file code:
- namespace a637
- {
- void Program::Main(std::vector<std::wstring> &args)
- {
- Random *ran = new Random();
- std::wstring output = L"";
- std::wstring input = File::ReadAllText(L"637.txt");
- std::vector<wchar_t> input_array = input.ToCharArray();
- for (int i = 0; i < input_array.size(); i++)
- {
- if (input_array[i] == L'A')
- {
- int tmp = ran->Next(0, 4);
- for (int j = 0; j < tmp; j++)
- {
- output += L"A";
- }
- }
- else if (input_array[i] == L'C')
- {
- int tmp = ran->Next(0, 9);
- for (int j = 0; j < tmp; j++)
- {
- output += L"C";
- }
- }
- else if (input_array[i] == L'G')
- {
- int tmp = ran->Next(0, 10);
- for (int j = 0; j < tmp; j++)
- {
- output += L"G";
- }
- }
- else if (input_array[i] == L'T')
- {
- int tmp = ran->Next(0, 10);
- for (int j = 0; j < tmp; j++)
- {
- output += L"T";
- }
- }
- else
- {
- }
- }
- std::vector<wchar_t> output_array = output.ToCharArray();
- std::wcout << output;
- std::getwchar();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement