Untitled
unknown
plain_text
2 years ago
476 B
12
Indexable
#include <stdio.h>
#include <stdlib.h> // Dla funkcji rand()
int main() {
unsigned int state = 0b1110011; // Stan generatora (seed)
// Generowanie i wyświetlanie 10 pseudolosowych liczb binarnie
for (int i = 0; i < 10; ++i) {
state = rand() % 64; // Generowanie liczby pseudolosowej z zakresu 0-63
for (int j = 5; j >= 0; j--) {
printf("%d", (state >> j) & 1);
}
printf("\n");
}
return 0;
}
Editor is loading...
Leave a Comment