fork download
  1. #include <iostream>
  2. #include <cstdlib>
  3. #include <ctime>
  4. #include <cstring>
  5.  
  6.  
  7. using namespace std;
  8.  
  9. int main()
  10. {
  11.  
  12. setlocale(LC_ALL, "Russian");
  13. string a = "Всем привет";
  14. int le = a.length();
  15. srand(time(NULL));
  16.  
  17. for(int i = 0; i < le; i++) {
  18. int const N = 6;
  19. char const* digits = "0123456789ABCDEF";
  20. char hexstring[N+1];
  21.  
  22.  
  23.  
  24. for (int f = 0; f < N; ++f) {
  25.  
  26. hexstring[f] = digits[random() & 15];
  27. }
  28. hexstring[N] = '\0';
  29.  
  30. cout << "[#" << hexstring << "]" << a[i];
  31.  
  32. }
  33. cout << endl;
  34. return 0;
  35. }
Success #stdin #stdout 0s 4404KB
stdin
Standard input is empty
stdout
[#201250]�[#E925E2]�[#76DA78]�[#0964CF]�[#668B4D]�[#36D592]�[#57C7CA]�[#9317E8]�[#FE162E] [#594D48]�[#B7F8C8]�[#B1F78B]�[#12F29D]�[#A8BCED]�[#A36E1A]�[#7C264E]�[#EF0D68]�[#88A7A3]�[#45CF1A]�[#DBE39F]�[#E0B06F]�