Advertisement
X-88

Randomize

Jan 13th, 2022
1,316
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.40 KB | None | 0 0
  1. #include <iostream>
  2. #include <random>
  3.  
  4. using namespace std;
  5.  
  6. int i,
  7.      r,
  8.      sn,
  9.      ns = 0,
  10.      sb = 543917264;
  11. string un, t, s = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
  12.  
  13. int main()
  14. {
  15.     cout << "Nama: ";
  16.     getline(cin, un);
  17. for (i = 0; i <= un.length(); i++)
  18. {
  19.     ns += int(un[i]);
  20.     r = rand() % sizeof(s) - 1;
  21.     t += s[r];
  22.     sn = sb - ns;
  23. }
  24.     cout << hex << sn << t;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement