#include <algorithm>
#include <ctime>
#include <functional>
#include <iostream>
#include <random>
#include <string>

int main()
{
    const std::size_t defaultStringLength = 50;

    //std::random_device seed;
    //std::mt19937 prne(seed());
    // random_device is way better, but no access to hardware at ideone
    std::mt19937 prne( std::time(NULL) );

    std::vector<double> bounds = {'A', 'Z'+1, 'a', 'z'+1};
    std::vector<double> weights = {   1,  0,   1};
    std::piecewise_constant_distribution<> d(bounds.begin(), bounds.end(), weights.begin());

    std::string s(defaultStringLength, ' ');

    std::generate(s.begin(), s.end(), bind(d, ref(prne)));

    std::cout << s << '\n';
}
