#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int random() {
float x;
x = x/100;
return x;
}
float prob() {
float p;
return p;
}
int label(float lattice[][4], float p) {
for(int i = 0; i < 4 ; i++)
for(int j = 0; j < 4; j++) {
lattice[i][j] = random();
}
for(int i = 0; i < 4; i++)
for(int j = 0; j < 4; j++) {
if(lattice[i][j] <= p)
lattice[i][j] = 1;
else
lattice[i][j] = 0;
}
return 0;
}
int main() {
float lattice[4][4];
float p = prob();
label(lattice, p);
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KI2luY2x1ZGUgPHRpbWUuaD4KCmludCByYW5kb20oKSB7CiAgICBmbG9hdCB4OwogICAgc3JhbmQoKHVuc2lnbmVkKXRpbWUoTlVMTCkpOwogICAgeCA9IHJhbmQoKSUxMDArMTsKICAgIHggPSB4LzEwMDsKICAgIHJldHVybiB4Owp9CgpmbG9hdCBwcm9iKCkgewogICAgZmxvYXQgcDsKICAgIHByaW50ZigiUHJvYmFiaWxpZGFkZTogIik7CiAgICBzY2FuZigiJWYiLCAmcCk7CiAgICByZXR1cm4gcDsKfQoKaW50IGxhYmVsKGZsb2F0IGxhdHRpY2VbXVs0XSwgZmxvYXQgcCkgewoJZm9yKGludCBpID0gMDsgaSA8IDQgOyBpKyspCgkgICAgZm9yKGludCBqID0gMDsgaiA8IDQ7IGorKykgewoJICAgICAgICBsYXR0aWNlW2ldW2pdID0gcmFuZG9tKCk7ICAgCgkgICAgfQoJCglmb3IoaW50IGkgPSAwOyBpIDwgNDsgaSsrKQoJICAgIGZvcihpbnQgaiA9IDA7IGogPCA0OyBqKyspIHsKCSAgICAgICAgaWYobGF0dGljZVtpXVtqXSA8PSBwKSAgICAgIAoJICAgICAgICAgICAgbGF0dGljZVtpXVtqXSA9IDE7CgkgICAgICAgIGVsc2UKCSAgICAgICAgICAgIGxhdHRpY2VbaV1bal0gPSAwOwoJICAgIH0KCXJldHVybiAwOwp9CgppbnQgbWFpbigpIHsKICAgIGZsb2F0IGxhdHRpY2VbNF1bNF07CiAgICBmbG9hdCBwID0gcHJvYigpOwogICAgbGFiZWwobGF0dGljZSwgcCk7CiAgICByZXR1cm4gMDsKfQ==