Skip to content

Instantly share code, notes, and snippets.

@iamvon
Created May 29, 2017 04:06
Show Gist options
  • Select an option

  • Save iamvon/5c2e3d030090b9e444aa7e44b1aebd1e to your computer and use it in GitHub Desktop.

Select an option

Save iamvon/5c2e3d030090b9e444aa7e44b1aebd1e to your computer and use it in GitHub Desktop.
#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
static const char chuoikytu [] =
"0123456789"
"abcdefghijklmnopqrstuvwxyz"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"!@#$%^&/?()_-+;:.•|~×÷`" ;
int size = sizeof(chuoikytu) - 1;
int main()
{
int length = 8;
srand(time(0));
for (int i = 0; i < length; i++)
{
cout << chuoikytu [rand() % size];
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment