#include <iostream>
#include <ctime>
using namespace std;
char* wypisz(unsigned short rej)
{
static char bufor[16] = { 0 };
unsigned short n = 0;
n = sprintf(bufor, "", rej);
for (int i = 15; i >= 0; i--)
n += sprintf(&bufor[n], "%d ", static_cast<bool>(rej & (1 << i)));
return bufor;
}
int main()
{
unsigned short rej = 0;
cout << wypisz(rej) << endl;
srand(time(0));
int a, b;
int tab[16][16];
int ileb[] = { 5,6,7,8,8,9,10,11 };
int *wsk = &ileb[0];
for (int i = 0; i <= 15; i++)
{
a = rand() % 7;
for (int k = 0; k < a; k++)
{
wsk++; //losowanie liczy bitow w stanie wysokim
}
for (int l = 0; l <= *wsk; l++)
{
b = rand() % 15;
rej |= (1 << b); //losowanie miejsc na ktorych bity beda rowne 1
}
wsk = &ileb[0];
cout << wypisz(rej) << endl;
rej = 0;
}
}
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}